leonardoxh / spring-gzip-filter Goto Github PK
View Code? Open in Web Editor NEWSpring GZIP Filter
License: Apache License 2.0
Spring GZIP Filter
License: Apache License 2.0
Thank you for the filter, I'm having an issue but I don't know if it's caused by this filter, spring, or maybe even the application server (WebSphere 8.5 Liberty Profile).
Basically, it works great when I hit a json/xml endpoint and get a 200 response, but when the endpoint throws an exception and returns an error, for example 400 Bad Request, Chrome shows an error ERR_CONTENT_DECODING_FAILED instead of displaying the actual 400 Bad Request
text.
A similar issue happens if I use curl
> GET /services/sec/v1/aewf HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.15.3 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: localhost:9080
> Accept-Encoding: deflate, gzip
> Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
>
< HTTP/1.1 400 Bad Request
< X-Powered-By: Servlet/3.0
< Content-Encoding: gzip
< Content-Type: text/html;charset=ISO-8859-1
< $WSEP:
< Content-Language: en-US
< Transfer-Encoding: chunked
< Connection: Close
< Date: Fri, 24 Apr 2015 20:05:30 GMT
<
* Error while processing content unencoding: invalid code lengths set
* Failed writing data
* Closing connection #0
curl: (23) Error while processing content unencoding: invalid code lengths set
Here it is without compression
> GET /services/sec/v1/aewf HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.15.3 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: localhost:9080
> Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
>
< HTTP/1.1 400 Bad Request
< X-Powered-By: Servlet/3.0
< Content-Type: text/html;charset=ISO-8859-1
< $WSEP:
< Content-Language: en-US
< Transfer-Encoding: chunked
< Connection: Close
< Date: Fri, 24 Apr 2015 20:14:59 GMT
<
Error 400: SRVE0295E: Error reported: 400
* Closing connection #0
The Error 400: SRVE0295E: Error reported: 400
is what should be displayed in Chrome too.
Have you seen this before, or do you know of a way to only compress json/xml responses?
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.