stokito opened a new pull request #337:
URL: https://github.com/apache/tomcat/pull/337


   In the scope of bef507e1b7ac2eb0ff012d0d40035e218a5839cc was added a bug:
   
   ```
   curl -vv http://localhost:8080/tomcat.png -H 'If-None-Match: 
W/"5103-1595887733334"'
   > GET /tomcat.png HTTP/1.1
   > Accept: */*
   > If-None-Match: W/"5103-1595887733334"
   > 
   < HTTP/1.1 304 
   < ETag: "5103-1595887733334"
   < Date: Tue, 11 Aug 2020 20:27:30 GMT
   ```
   
   The real ETag is weak `W/"5103-1595887733334"` but returned in response was 
strict `"5103-1595887733334"`.
   This happens because on line 2261 we value of `eTag` variable is changed:
   
         if (eTag.startsWith("W/")) {
               eTag = eTag.substring(2);
         }
   
   and then it goes to response.
   The PR fixes this. Also I tried to make the both `checkIfNoneMatch()` and 
`checkIfMatch()` functions looking similar.
   Now we can extract their common logic to a separate function.
   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to