c-e:gzip silently decoded when HTTP/2 is used · Issue #661 · curl/curl · GitHub
Skip to content You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert c-e:gzip silently decoded when HTTP/2 is used #661 New issue Copy link New issue Copy link Closed Closed c-e:gzip silently decoded when HTTP/2 is used #661 Copy link Assignees Labels HTTP/2 Description kazuho opened on Feb 16, 2016 Issue body actions If HTTP/1 is used, curl -H Accept-Encoding:gzip returns gzipped content, when connecting to a server that sends the response with Content-Encoding: gzip specified.
However when HTTP/2 is used, the response is decompressed by curl itself. Steps to reproduce: build and run h2o with this configuration file ; a text file should be stored in the document root run curl -H Accept-Encoding:zip http://127.0.0.1:8080/name-of-the-text-file | gzip -cd . The original text shows up run curl --http2 -H Accept-Encoding:gzip http://127.0.0.1:8080/name-of-the-text-file | gzip -cd . gzip complains: gzip: unknown compression format , since curl itself decodes the content-encoding in this case.
Activity bagder added HTTP/2 on Feb 16, 2016 bagder commented on Feb 16, 2016 bagder on Feb 16, 2016 Member More actions Right. Made on purpose: https://github.com/curl/curl/blob/master/lib/http.c#L3596 ... introduced in commit 133cdd2 by @FabianFrank : A server might respond with a content-encoding header and a response that was encoded accordingly in HTTP-draft-09/2.0 mode, even if the client did not send an accept-encoding header earlier.
The server might not send a content-encoding header if the identity encoding was used to encode the response. See: http://tools.ietf.org/html/draft-ietf-httpbis-http2-09#section-9.3 bagder commented on Feb 16, 2016 bagder on Feb 16, 2016 Member More actions As far as I can tell, that's just a trace for our support of earlier h2 versions and we should remove that again. Anyone disagreeing with that? bagder self-assigned this on Feb 16, 2016 kazuho commented on Feb 17, 2016 kazuho on Feb 17, 2016 Contributor Author More actions @bagder Thank you for looking into the issue.
As far as I can tell, that's just a trace for our support of earlier h2 versions and we should remove that again. +1 Considering the fact that curl automatically uses HTTP/2 for https (after a successful negotation using ALPN), I think that would be the only way to preserve compatibility with older versions of curl with support for HTTP/1 only. kazuho added a commit that references this issue on Feb 17, 2016 skip tests affected by curl/curl#661 13d0571 FabianFrank commented on Feb 17, 2016 FabianFrank on Feb 17, 2016 Contributor More actions I agree with @bagder , the gzip requirement part of the draft that resulted in this code didn't make it into the final RFC and the code should thus no longer be needed. bagder closed this as completed in eb083e0 on Feb 17, 2016 bagder commented on Feb 17, 2016 bagder on Feb 17, 2016 Member More actions Thanks, both of you! mingodad added a commit that references this issue on Feb 17, 2016 skip tests affected by curl/curl#661 ed33dd8 lock locked as resolved and limited conversation to collaborators on May 7, 2018 Sign up for free to join this conversation on GitHub.
Already have an account? Sign in to comment Metadata Metadata Assignees bagder Labels HTTP/2 Type No type Projects No projects Milestone No milestone Relationships None yet Development No branches or pull requests Issue actions You can’t perform that action at this time.