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

Fix compression issue #2248

Merged
merged 1 commit into from
Jun 1, 2018
Merged

Fix compression issue #2248

merged 1 commit into from
Jun 1, 2018

Conversation

nwmac
Copy link
Contributor

@nwmac nwmac commented May 31, 2018

This is a fix for the compression issue that does not require compression to be tuned off.

Long and short is the issue boiled down to the fact that when the back-end proxies API requests, it forwards (most of) the headers as well.

The golang http library (see: https://golang.org/src/net/http/transport.go, line 1973), assumes that if the Accept-Encoding header is set by the client, then it will handle uncompressing the response if it is compressed.

Since the browser typically sends us this header, we forward it on and in the case of backends using compression, we get back a compressed response which the go library assumes that we will uncompress, which we do not.

The fix is simply to not forward the Accepts-Encoding header and to let the go library do its thing - it will add in gzip and uncompress the response for us if necessary

@nwmac nwmac self-assigned this May 31, 2018
@cfdreddbot
Copy link

Hey nwmac!

Thanks for submitting this pull request! I'm here to inform the recipients of the pull request that you and the commit authors have already signed the CLA.

@codecov
Copy link

codecov bot commented May 31, 2018

Codecov Report

Merging #2248 into v2-master will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           v2-master    #2248   +/-   ##
==========================================
  Coverage      71.78%   71.78%           
==========================================
  Files            565      565           
  Lines          23192    23192           
  Branches        5205     5205           
==========================================
  Hits           16649    16649           
  Misses          6543     6543

@KlapTrap KlapTrap merged commit 259743e into v2-master Jun 1, 2018
@KlapTrap KlapTrap deleted the compression-fix branch June 1, 2018 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants