-
Notifications
You must be signed in to change notification settings - Fork 691
Description
I'm using reactor-netty via Spring boot and I configured compressOptions where I only modified the ZstdOption
httpServer.compressOptions(
ZstdOption.builder()... .build()
)
When configuring compressOptions, the default windowBits values for GZIP and Deflate compression are unexpectedly overridden by Reactor Netty's defaults, rather than retaining Netty's original defaults. This behavior is not clearly documented and may lead to unexpected failures.
We're observing that any request relying on GZIP or Deflate compression silently fails and remains pending indefinitely when windowBits is changed from the default 15 to 12 — as happens when compressOptions are customized.
Expected Behavior
Only the configuration of the configured compression algorithm shall change and no other algorithms shall be impacted (GZIP, Defalte).
Actual Behavior
The defaults applied for GZIP and Defalte differ.
For instance, for GZIP the window bits are set to 12 bits
reactor-netty/reactor-netty-http/src/main/java/reactor/netty/http/server/compression/GzipOption.java
Line 92 in 85590ae
| private int windowBits = 12; |
When no compressOptions are specified, it will apply the defaults from Netty. Otherwise the ones from reactor-netty are applied - which unfortunately differ in windowBits.
https://github.com/netty/netty/blob/netty-4.1.118.Final/codec-http/src/main/java/io/netty/handler/codec/http/HttpContentCompressor.java#L182
Possible Solution
Align the defaults with the standards of Netty.
Workaround
Aligning windows bits to 15 explicitly:
httpServer.compressOptions(
GzipOption.builder().windowBits(15).build(),
DeflateOption.builder().windowBits(15).build(),
ZstdOption.builder().....build()
)
Your Environment
- Reactor version(s) used: 1.2.3
- Netty: 4.1.118
- JVM version: 21