-
Bug
-
Resolution: Duplicate
-
Critical
-
None
-
7.1.0.CR2
Description:
By default, RESTEasy returns wrong Content-Encoding data if client request gzip data and if RESTEasy end-point contains @GZiP annotation
- Server contains end-point with @GZIP annotation, for example this:
@GET @Path("/echo") @GZIP String echo(@QueryParam("name") String message);
- RESTEasy client send request with "Accept-Encoding: gzip, deflate"
- By default, server doesn't use GZIPDecodingInterceptor, GZIPEncodingInterceptor and AcceptEncodingGZIPFilter. So server doesn't compress data
- server sends "Content-Encoding: gzip" in header of response, although data is not compressed
Steps to reproduce in EAP 7.1:
- download attached reproducer
- mvn clean package -Djboss.home=${JBOSS_HOME} -Dmaven.test.failure.ignore=true
Some technical details from same issue in master branch:
Server returns gzip in header , because "gzip" is in "Set<String> encodings;" [4] from ServerContentEncodingAnnotationFilter class. Resteasy checks all annotations in end-point method:
@GET @Path("/echo") @GZIP String echo(@QueryParam("name") String message);
Resteasy find @GZIP annotation and check, if @GZIP annotation has @ContentEncoding annotation here [5]. GZIP annotation has @ContentEncoding, see [6]. So Resteasy return gzip in response header, although Resteasy doesn't compress data.
[4] https://github.com/resteasy/Resteasy/blob/master/resteasy-jaxrs/src/main/java/org/jboss/resteasy/plugins/interceptors/ServerContentEncodingAnnotationFilter.java#L31
[5] https://github.com/resteasy/Resteasy/blob/master/resteasy-jaxrs/src/main/java/org/jboss/resteasy/plugins/interceptors/ServerContentEncodingAnnotationFeature.java#L49
[6] https://github.com/resteasy/Resteasy/blob/master/resteasy-jaxrs/src/main/java/org/jboss/resteasy/annotations/GZIP.java#L14
- duplicates
-
RESTEASY-1735 RESTEasy returns wrong Content-Encoding data if client request gzip
- Closed
- is incorporated by
-
JBEAP-13737 (7.2.0) Upgrade RESTEasy from 3.0.24.Final to 3.0.25.Final
- Resolved