Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not fail when compressing empty HttpContent (#13655)
Motivation: HttpContentCompressor fails with an exception when trying to write an empty HttpContent: ``` io.netty.handler.codec.EncoderException: MessageToMessageCodec$1 must produce at least one message. at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:99) at io.netty.handler.codec.MessageToMessageCodec.write(MessageToMessageCodec.java:116) at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:879) at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:863) at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:968) at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:856) at io.netty.channel.ChannelDuplexHandler.write(ChannelDuplexHandler.java:115) ``` Modification: If the compression has no output, write an empty dummy HttpContent. This is not an ideal solution, but this should not happen often anyway. Result: HttpContentCompressor does not fail anymore. --------- Co-authored-by: Norman Maurer <norman_maurer@apple.com>
- Loading branch information