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

Handle user error on Gzip response #142

Closed
jeevatkm opened this issue Apr 13, 2018 · 0 comments
Closed

Handle user error on Gzip response #142

jeevatkm opened this issue Apr 13, 2018 · 0 comments
Assignees

Comments

@jeevatkm
Copy link
Member

jeevatkm commented Apr 13, 2018

As everyone knows, certainly Go default client handles Gzip response. However there is a catch in it.

From https://github.com/golang/go/blob/master/src/net/http/transport.go

// DisableCompression, if true, prevents the Transport from
// requesting compression with an "Accept-Encoding: gzip"
// request header when the Request contains no existing
// Accept-Encoding value. If the Transport requests gzip on
// its own and gets a gzipped response, it's transparently
// decoded in the Response.Body. However, if the user
// explicitly requested gzip it is not automatically
// uncompressed.
DisableCompression bool

So if user by any chance adds header Accept-Encoding: gzip manually via resty then response will have an issue.

Goal is to add grace handling support for user error.

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

No branches or pull requests

1 participant