Skip to content

Conversation

mjwbenton
Copy link
Contributor

As discussed on Discord here: https://discord.com/channels/1283128968140161065/1286094576788177059/1291327268450467893

Using rewrites with an external server currently has an issue when the server responds with a compressed response. proxyRequest decompresses the response, and suitably filters out the content-encoding header from the response to indicate that it is not compressed. However currently it still passes through the content-length header untouched. This means that downstream the response gets truncated to the length of the compressed response even though a decompressed response is being sent.

This PR filters out the optional content-length header such that the content does not get truncated.

Thanks!

Copy link
Contributor

@conico974 conico974 left a comment

Choose a reason for hiding this comment

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

LGTM Thanks

@conico974 conico974 merged commit 8b576d9 into opennextjs:main Oct 3, 2024
1 check 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.

2 participants