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

waiProxy: Remove Content-Length for Encoded Responses #47

Merged
merged 1 commit into from
Jun 9, 2024

Conversation

bjin
Copy link
Contributor

@bjin bjin commented Jun 6, 2024

This is a proper fix to #45.

In previous merge request (#45), for HTTP/2 connections, Content-Length header is retained in order to avoid problems with Docker client rejecting chunked encoding responses from Docker registry.

However, this approach failed when the upstream response was encoded (e.g. with 'Content-Encoding: gzip' in header). The retained 'Content-Length' header then mismatched the actual content size after decoding.

To fix this, we now strip the Content-Length header if Content-Encoding header is present, along with our existing checks for cases where chunked encoding is not used (HTTP/2 and HEAD requests).

This is a proper fix to fpco#45.

In previous merge request (fpco#45), for HTTP/2 connections, Content-Length
header is retained in order to avoid problems with Docker client rejecting
chunked encoding responses from Docker registry.

However, this approach failed when the upstream response was encoded
(e.g. with 'Content-Encoding: gzip' in header). The retained
'Content-Length' header then mismatched the actual content size after
decoding.

To fix this, we now strip the Content-Length header if Content-Encoding
header is present, along with our existing checks for cases where chunked
encoding is not used (HTTP/2 and HEAD requests).
@snoyberg snoyberg merged commit 77a936e into fpco:master Jun 9, 2024
6 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants