Bug 41666

Summary: If-Unmodified-Since failure
Product: Tomcat 5 Reporter: Suzuki Yuichiro <suzuki.yuichiro>
Component: CatalinaAssignee: Tomcat Developers Mailing List <dev>
Severity: minor    
Priority: P4    
Version: 5.5.20   
Target Milestone: ---   
Hardware: All   
OS: All   

Description Suzuki Yuichiro 2007-02-21 01:44:28 UTC
The If-Unmodified-Since header doesn't work enoughly.

failed case:
 The If-Unmodified-Since header value: 1000000(milliseconds)
 The lastModified value of target resource: 1001000(milliseconds)

In this case, the response's status code should be SC_PRECONDITION_FAILED,
but the result is not so.

caused by:
In DefaultServlet#checkIfUnmodifiedSince:
    if ( lastModified > (headerValue + 1000)) {

I think it should be:
    if ( lastModified >= (headerValue + 1000)) {
Comment 1 Suzuki Yuichiro 2007-02-21 16:36:31 UTC
If-Modified-Since is also similar. 
Comment 2 Mark Thomas 2007-02-25 20:06:30 UTC
Fixed in svn. This will be included in 5.5.23 onwards.