Fixes #166 [router] Return all response headers unmodified #167
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context:
Issue: #166
Summary:
Accept-Encoding: gzip
header to each proxied request in all versions before 0.21.x (this behaviour was changed in v0.21: Avoid adding gzip-encoding to requests implicitly knative/serving#10691)Accept-Encoding: gzip
, and if any of these components supports compression – the response will be gzippedContent-Encoding: gzip
) and decodes it accordinglyContent-Encoding: gzip
is missing in the response that the router sends back to Knative's queue-proxy. And subsequently, Knative sends the response back to the client unmodified (i.e. compressed)Solution:
In order to avoid such an unexpected behavior as returning a compressed response when the client doesn't request it, Turing router needs to let
queue-proxy
know if the response is compressed (i.e. propagateContent-Encoding
header), soqueue-proxy
can handle it accordingly and decode the response before sending it to the client.Currently, Turing router strips all of the response headers except
Content-Type
. This PR fixes this by propagating all of the responses back to thequeue-proxy
(and subsequently – the client).