Add support for server-side request decompression
See original GitHub issueCurrently, Spring Boot seems to ingore the Content-Encoding header when dispatching a HTTP request received from a client. This manifests in unmarshalling error deep inside the Spring stack unless one adds an interceptor to transform any HttpServletRequest. Adding such an interceptor is cumbersome as the servlet API requires the implementation of a rather heavy wrapper object.
I argue that Spring Boot should be capable of detecting the header before disaptching to a controller. Ideally, Spring Boot should make an attempt to wrap the input stream before it is unmarshalled to apply unzipping. At a minimum, Spring Boot should detect that the header is present and present a better error message.
The decompression attempt could also be controlled by the server.compression.enabled property.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:8
- Comments:8 (4 by maintainers)

Top Related StackOverflow Question
While the Jetty enhancement request is still open, the same or very similar functionality appears to have been included in 9.4. See https://github.com/eclipse/jetty.project/pull/964 for details. I’m still watching the Tomcat issue so we can re-open this if it’s addressed. In the meantime, the functionality can be enabled relatively easily on Jetty and Undertow using a customiser.
I’m watching both the Jetty and Tomcat issues but neither seems to have any traction at the moment. I’m going to close this issue for now. We can re-open it if the functionality becomes available in the future and look at what we need to do to make it readily available in Boot.