jetty.project
jetty.project copied to clipboard
GzipHttpOutputInterceptor does not deflate when Accept-Encoding: * is in the request header.
Jetty version(s) Up to 12.0.x
Jetty Environment core
Java version/vendor (use: java -version)
Not relevant
OS type/version Not relevant
Description This doesn't really affect anything, but it is unexpected. According to RF9110 12.5.3,
The asterisk "*" symbol in an Accept-Encoding field matches any available content coding not explicitly listed in the field.
However, the HttpField class' contains method does not check for a lone * character. So when Accept-Encoding: * is passed as a request header, the GzipHandler's getDeflaterEntry believes that gzip is not accepted, and returns null.
How to reproduce?
Run a simple web server with the GzipHandler installed, and send a request with Accept-Encoding: *. The response will not contain the Content-Encoding: gzip header, and the body will not be compressed.