Upstream content encoding misalignment between Http1x and Http2
Author: bjornhusbergCreated Sep 3, 2024Updated Sep 10, 2026
Labelsdefect
Expected behavior
When manually setting the Content-Encoding header and sending an already encoded response the Http1 and Http2 codec should both behave the same, ie they should pass through the already encoded stream and not modify the Content-Encoding header.
Actual behavior
The Http2 codec takes the Content-Encoding header as a hint on how the result should be encoded and then encodes the already encoded stream a second time, resulting in garbage on the client side. Compare the logic in the Http2 codec:
to the logic in the corresponding Http1 codec:
Netty version
4.1
Source: netty/netty