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

accept-encoding should not default to gzip #581

Open
bahamat opened this issue Dec 3, 2020 · 2 comments
Open

accept-encoding should not default to gzip #581

bahamat opened this issue Dec 3, 2020 · 2 comments
Assignees
Labels

Comments

@bahamat
Copy link
Member

bahamat commented Dec 3, 2020

The SDK defaults to Accept-Encoding: gzip, but doesn't decompress the stream for consumers. This leaves them with a stream that they need to explicitly decompress, which is undocumented. The default behavior should be working with little to no extra effort. So the SDK needs to either decompress it automatically or default to no encoding.

The preference is to skip encoding. If consumers want to encode, they can pass the header explicitly and handle decompression themselves.

@indianwhocodes
Copy link
Contributor

indianwhocodes commented Dec 3, 2020

@bahamat As I see from RFC-2616#14.3 we have two options here:

  1. If the content-coding is one of the content-codings listed in
     the Accept-Encoding field, then it is acceptable, unless it is
     accompanied by a value of 0. (As defined in section 3.9, a
     qvalue of 0 means "not acceptable.")

  2. The special "*" symbol in an Accept-Encoding field matches any
     available content-coding not explicitly listed in the header
     field.

  3. If multiple content-codings are acceptable, then the acceptable
     content-coding with the highest non-zero qvalue is preferred.

  4. The "identity" content-coding is always acceptable, unless
     specifically refused because the Accept-Encoding field includes
     "identity;q=0", or because the field includes "*;q=0" and does
     not explicitly include the "identity" content-coding. If the
     Accept-Encoding field-value is empty, then only the "identity"
     encoding is acceptable.

So we can either have the SDK set the default value to identity or *. I would prefer the latter. Thoughts ?

@indianwhocodes
Copy link
Contributor

This issue can be resolved by adding a new line such as

new BasicHeader(HttpHeaders.ACCEPT_ENCODING, "*")

in MantaHttpRequestFactory.java at L45 and the update the API docs accordingly.

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

No branches or pull requests

2 participants