-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Other Transfer-Encodings, such as Gzip, Compress, Deflate, etc #2
Comments
Compression specifically could be left up to downstream things to implement. Not sure this is the domain of an http library. |
Looking through the spec, it does seem like its an optional thing, as opposed to chunked which the spec says a server MUST understand chunked to 1.1 compatibile. |
Some servers send me a gzip-compressed response without me asking for it, so practically I must always be prepared for such responses. Unfortunately the RFC's language isn't very clear what the server is supposed to do if no
https://tools.ietf.org/html/rfc2616#section-14.3 From the newer RFC 7231:
|
A header of "Accept-Encoding: identity" means the user agent is On Sat, Jan 23, 2016, 11:22 AM Markus Unterwaditzer <
|
Probably, though I'd still prefer if Hyper handled this transparently for me (even if behind a featureflag). Would setting this as a default header (on Hyper's side) be acceptable? |
I'm not so certain that this is a decision that hyper should default to. As you noticed in 7231, sending no header is valid, and implies no preference. If a user of hyper hasn't stated otherwise, I don't think we can assume a preference. A higher level Client wrapper would probably be the place to be more opinionated, methinks. |
This has bitten me again. This time a different library, @SimonSapin's kuchiki provides a
If a user of hyper hasn't stated otherwise, I don't think we can assume they'd thought about it. |
Again, does asking for identity fix the issue? |
Sorry, it seems to be an issue with the server in this case. EDIT: Yes, in the previous instance, setting Accept-Encoding: identity helped. |
(@untitaker I’ve extended kuchiki’s |
@seanmonstar is it possible to set the headers once per client, so that we don't have do add them with every request? |
@Trolldemorted not in hyper. Such a feature does exist in reqwest, though! |
No description provided.
The text was updated successfully, but these errors were encountered: