Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
waiProxy: Remove Content-Length for Encoded Responses
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).
- Loading branch information