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

Avoid adding gzip-encoding to requests implicitly #10691

Merged
merged 1 commit into from Feb 3, 2021

Conversation

julz
Copy link
Member

@julz julz commented Feb 3, 2021

See knative/pkg#2006.

Go helpfully adds an Accept-Encoding: gzip header to requests by
default, and silently uncompresses the response if it did so and the
server added compression in response. While this is normally a good
thing, in our case this means we silently add an extra "Accept-Encoding"
header to requests before they get to the user container, and if the
user container compresses the request in response we end up pointlessly
uncompressing the just-compressed response inside Queue Proxy. This
commit picks up the new NewProxyAutoTransport method from pkg
to avoid this behaviour.

Avoids implicitly adding an "Accept-Encoding: gzip" header to proxied requests if one was not already present.

/assign @vagababov @markusthoemmes

Go helpfully adds an Accept-Encoding: gzip header to requests by
default, and silently uncompresses the response if it did so and the
server added compression in response. While this is normally a good
thing, in our case this means we silently add an extra "Accept-Encoding"
header to requests before they get to the user container, and if the
user container compresses the request in response we then pointlessly
uncompress the response inside Queue Proxy. This commit picks up the new
NewProxyAutoTransport method from pkg to avoid this behaviour.
@google-cla google-cla bot added the cla: yes Indicates the PR's author has signed the CLA. label Feb 3, 2021
@knative-prow-robot knative-prow-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. area/autoscale area/networking labels Feb 3, 2021
@codecov
Copy link

codecov bot commented Feb 3, 2021

Codecov Report

Merging #10691 (6944ee6) into master (ae7b278) will increase coverage by 0.05%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10691      +/-   ##
==========================================
+ Coverage   88.12%   88.17%   +0.05%     
==========================================
  Files         186      186              
  Lines        8898     8898              
==========================================
+ Hits         7841     7846       +5     
+ Misses        815      813       -2     
+ Partials      242      239       -3     
Impacted Files Coverage Δ
cmd/activator/main.go 0.00% <0.00%> (ø)
cmd/queue/main.go 0.51% <0.00%> (ø)
pkg/activator/net/revision_backends.go 91.32% <0.00%> (ø)
pkg/reconciler/autoscaling/kpa/scaler.go 90.14% <0.00%> (+1.40%) ⬆️
pkg/reconciler/configuration/configuration.go 88.28% <0.00%> (+2.34%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ae7b278...f36d9bd. Read the comment docs.

@dprotaso
Copy link
Member

dprotaso commented Feb 3, 2021

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 3, 2021
Copy link
Contributor

@vagababov vagababov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: julz, vagababov

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 3, 2021
@knative-prow-robot knative-prow-robot merged commit 58550fd into knative:master Feb 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/autoscale area/networking cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants