arturobernalg opened a new pull request, #1144:
URL: https://github.com/apache/tomcat/pull/1144

   RFC 9110, section 5.6.6 states: "Parameter names are case-insensitive." The 
weight is the ABNF string "q=" (section 12.4.2), and ABNF strings are 
case-insensitive (RFC 5234, section 2.3), so `Q=0.5` is a valid weight.
   
   `HttpParser.readWeight` only accepted a lower case `q`, so `gzip;Q=0` in 
Accept-Encoding (and the equivalent in Accept-Language) was treated as 
malformed and dropped. For Accept-Encoding that matters: in `gzip;Q=0, *` the 
exclusion is lost and the `*` entry makes `CompressionConfig` compress with 
gzip although the client excluded it. `TE.parse` looked up `q` 
case-sensitively, so `deflate;Q=0` was kept as an ordinary parameter with a 
quality of 1.
   
   This change accepts an upper case `Q` in `readWeight` and lower cases the 
parameter names in `TE`.
   
   TestAcceptEncoding, TestAcceptLanguage and TestTE each have a new test that 
fails without the change and passes with it. The whole 
`org.apache.tomcat.util.http.parser` test package, TestCompressionConfig and 
TestRequest pass.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to