Menu

#1429 http/2 headers/body printing

closed-invalid
http2 (7)
5
2014-10-25
2014-09-29
No

It seems in some scenarios curl is not printing out request/response headers and body content. For example the following request is invalid and correctly prints out the response headers:

$ curl --http2 -k 'https://10.0.2.2:13443/proxy/address' -d 'INVALID CONTENT' -i
HTTP/2.0 400
server:http2query2

However the following 2 requests are valid but does not print out any response headers:

$ curl --http2 -k 'https://10.0.2.2:13443/proxy/address' -d 'VALID CONTENT' -i
$
$ curl --http2 -k 'https://10.0.2.2:13443/proxy/address' -d 'VALID CONTENT' -s -D -
$

Also the body is not printed in the second case.

Discussion

  • Scott Mitchell

    Scott Mitchell - 2014-09-29

    Ignore the parts about the body not being printed at the end. This response has no body for these requests.

     

    Last edit: Scott Mitchell 2014-09-29
  • Daniel Stenberg

    Daniel Stenberg - 2014-09-29
    • status: open --> pending-needsinfo
    • assigned_to: Daniel Stenberg
     
  • Daniel Stenberg

    Daniel Stenberg - 2014-09-29

    Ok, so what's left on this bug report? That -i isn't including the headers in the regular output?

    It does for me, I just did this command line successfully:

    $ curl --http2 https://nghttp2.org/ -i -o dump

     
  • Scott Mitchell

    Scott Mitchell - 2014-10-01

    I am able to see the connection statistics but I am still not seeing response headers (or any other content in your example). I am using the latest on master. Should I be using a specific tag?

    $ curl --version
    curl 7.38.1-DEV (x86_64-unknown-linux-gnu) libcurl/7.38.1-DEV OpenSSL/1.0.2 zlib/1.2.8 nghttp2/0.6.2-DEV
    Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smtp smtps telnet tftp
    Features: IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP HTTP2

    $ curl --http2 https://nghttp2.org/ -i -o dump
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    100 17763 100 17763 0 0 15441 0 0:00:01 0:00:01 --:--:-- 15486

     
  • Daniel Stenberg

    Daniel Stenberg - 2014-10-02

    So what do you see? I tried again just now and it works fine for me. Add "--trace-ascii dump2" and attached that dump2 file for us to take a look!

    Can you really negotiate ALPN with that OpenSSL version?

    My test version reports this:

    $ ./src/curl --version
    curl 7.38.1-DEV (x86_64-unknown-linux-gnu) libcurl/7.38.1-DEV OpenSSL/1.1.0 zlib/1.2.8 c-ares/1.10.1-DEV libidn/1.29 libssh2/1.4.4_DEV nghttp2/0.6.2-DEV librtmp/2.3
    Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smtp smtps telnet tftp
    Features: AsynchDNS Debug TrackMemory IDN IPv6 Largefile GSS-API SPNEGO NTLM NTLM_WB SSL libz TLS-SRP HTTP2 Metalink

     
  • Scott Mitchell

    Scott Mitchell - 2014-10-02

    My mistake. I apologize...I do see the responses for the curl --http2 https://nghttp2.org/ -i -o dump --trace-ascii dump2 request (both dump and dump2 have reasonable content). I'm a curl novice and am not familiar with the flags...I was looking for results on the console.

    However I still think there is an issue with the results not being printed if their is no response body and the status code is 200. I couldn't find a scenario for this on https://nghttp2.org/httpbin but my web server supports a request that only provides a header response. I have not been able to generalize it past this because if my server responds with a non-200 code I see the dump file (using the syntax above), but it is not generated if the return code is 200. The --trace-ascii dump2 is produced in both situations however (see attached files).

    Can you really negotiate ALPN with that OpenSSL version?

    Yes. ALPN support was added in openssl 1.0.2 according to their website

     
  • Daniel Stenberg

    Daniel Stenberg - 2014-10-06

    You mean like when running "curl --http2 -I https://nghttp2.org/" ?

    Seems to work fine for me!

     
  • Scott Mitchell

    Scott Mitchell - 2014-10-06

    From a print out perspective, yes this is what I expect. However this example is not equivalent to the description I provided. This example URL is returning headers and a body. If you have an example that only returns headers that would be equivalent.

     
  • Scott Mitchell

    Scott Mitchell - 2014-10-06

    I am guessing (without looking at code) that the END_STREAM flag in the headers frame is not being used the same way that a content-length: 0 header might be to inidate no more response is coming?

     
  • Daniel Stenberg

    Daniel Stenberg - 2014-10-06

    My example did only output headers and no body. Can you please provide me with an example against a public URL that repeats the problem you're talking about?

    How is END_STREAM related to how we output headers or not?

     
  • Daniel Stenberg

    Daniel Stenberg - 2014-10-25

    No further response, closing.

     
  • Daniel Stenberg

    Daniel Stenberg - 2014-10-25
    • status: pending-needsinfo --> closed-invalid
     
MongoDB Logo MongoDB