Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Inconsistent response header representation for HTTP/1.1 vs HTTP/2 #797
When asking curl to print the HTTP headers (either by using
I did this
(The only difference is
I expected the following
The same representation of the output from both commands.
(Note the lack of spaces after the colons in the HTTP/2 representation.)
curl 7.48.0 (x86_64-apple-darwin15.4.0) libcurl/7.48.0 OpenSSL/1.0.2g zlib/1.2.5 nghttp2/1.9.2
Mac OS X El Capitan 10.11.5 Beta (15F31a)
Some extra notes:
Obviously some deviation from the standard representation is expected from HTTP/1.1 and HTTP/2. Most obviously, the version number will be different, as will header case (HTTP/2 implementations uniformly downcase their headers).
However, curl clearly makes some effort to represent the HTTP/2 message as a HTTP/1.1-style message, as shown by the
My suggestion is therefore that curl should insert a single space between the header name and value for HTTP/2 headers.
referenced this issue
May 11, 2016
Because the space is missing after the colon? I disagree. It's allowed to omit the space in HTTP 1.x.
But of course libcurl could add the space to make the headers look more similar to HTTP 1.x headers. Apache's mod_http2 even converts the header names to camel case (e.g. "content-length" --> "Content-Length")