question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support for server-side request decompression

See original GitHub issue

Currently, 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:closed
  • Created 6 years ago
  • Reactions:8
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
wilkinsonacommented, Sep 6, 2018

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.

1reaction
wilkinsonacommented, Apr 26, 2018

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Request decompression in ASP.NET Core - Microsoft Learn
Learn how to use the request decompression middleware in ASP. ... Support for custom encodings can be added by creating custom decompression ......
Read more >
How to decompress json data request at server side?
I want to decompress and print the JSON data (that i got from client request) in java. Client code: #!/usr/bin/python import sys, getopt...
Read more >
Compression and Decompression | NGINX Plus
Compress server responses, or decompress them for clients that don't support compression, to improve delivery speed and reduce overhead on the server.
Read more >
Chapter 29. GZIP Compression/Decompression - JBoss.org
If the client framework is sending a request or the server is sending a response with the Content-Encoding header set to "gzip", Resteasy...
Read more >
Enabling payload compression for an API - AWS Documentation
API Gateway allows your client to call your API with compressed payloads ... By default, API Gateway supports decompression of the method request...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found