Skip to content

waiProxy: Remove Content-Length for Encoded Responses#47

Merged
snoyberg merged 1 commit intofpco:masterfrom
bjin:fix-encoding
Jun 9, 2024
Merged

waiProxy: Remove Content-Length for Encoded Responses#47
snoyberg merged 1 commit intofpco:masterfrom
bjin:fix-encoding

Conversation

@bjin
Copy link
Copy Markdown
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
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.

2 participants