Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please support Transfer-Encoding: gzip, too #13

Open
stapelberg opened this issue May 15, 2020 · 1 comment
Open

Please support Transfer-Encoding: gzip, too #13

stapelberg opened this issue May 15, 2020 · 1 comment

Comments

@stapelberg
Copy link

stapelberg commented May 15, 2020

curl has an option:

--tr-encoding
(HTTP) Request a compressed Transfer-Encoding response using one of the algorithms curl supports, and uncompress the data while receiving it.

Using it results in a TE header and the Connection header set to TE.

% curl -v  --tr-encoding http://localhost/pkg/nano-amd64-4.9.2-5.squashfs | hexdump -C | head
> GET /pkg/nano-amd64-4.9.2-5.squashfs HTTP/1.1
> Host: localhost
> User-Agent: curl/7.69.0
> Accept: */*
> Connection: TE
> TE: gzip
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Accept-Ranges: bytes
< Content-Length: 2375680
< Content-Type: application/octet-stream
< Last-Modified: Mon, 11 May 2020 08:33:31 GMT
< Date: Fri, 15 May 2020 17:16:25 GMT

[uncompressed file contents]

If I understand the answers at https://stackoverflow.com/questions/11641923/transfer-encoding-gzip-vs-content-encoding-gzip?rq=1 correctly, transfer-encoding is the better header to use for opting into compression (because it does not mess with proxies), but also the more rarely used one.

It would be great if this package would not only support Accept-Encoding, but also Transfer-Encoding, so that curl users can opt into compression.

@lpar
Copy link
Owner

lpar commented Jun 8, 2020

Note that you can set accept-encoding using curl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants