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.
If HTTP/1 is used,
curl -H Accept-Encoding:gzipreturns gzipped content, when connecting to a server that sends the response withContent-Encoding: gzipspecified.However when HTTP/2 is used, the response is decompressed by curl itself.
Steps to reproduce:
curl -H Accept-Encoding:zip http://127.0.0.1:8080/name-of-the-text-file | gzip -cd. The original text shows upcurl --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.