helidon-io / helidon

Java libraries for writing microservices
https://helidon.io
Apache License 2.0
3.44k stars 562 forks source link

4.x: WebServer double compression (re-encoding) #8837

Open barchetta opened 1 month ago

barchetta commented 1 month ago

Environment Details


Problem Description

A customer has reported that WebServer will compress outgoing responses even if the handler sets Content-Encoding: gzip on the response. Apparently in Helidon 3 if the Content-Encoding header was set then the content would not be re-encoded.

The documentation does not describe how explicitly setting Content-Encoding by the handler impacts content negotiation.

Also, it appears as though the enable-compression configuration option was removed in 4.x. The only place I found this was in tests/functional/mp-compression. I'm guessing that's leftover cruft.

The upgrade guide does not mention what happened to enable-compression. Maybe it should.

Steps to reproduce

Reproducer:

ContentEncodingTest.java.txt