You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2007/02/26 05:06:07 UTC

svn commit: r511716 - in /tomcat/container/tc5.5.x: catalina/src/share/org/apache/catalina/servlets/DefaultServlet.java webapps/docs/changelog.xml

Author: markt
Date: Sun Feb 25 20:06:07 2007
New Revision: 511716

URL: http://svn.apache.org/viewvc?view=rev&rev=511716
Log:
Fix bug 41666. Correct handling of boundary conditions for If-Unmodified-Since and If-Modified-Since headers. Patch provided by Suzuki Yuichiro.

Modified:
    tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/servlets/DefaultServlet.java
    tomcat/container/tc5.5.x/webapps/docs/changelog.xml

Modified: tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/servlets/DefaultServlet.java
URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/servlets/DefaultServlet.java?view=diff&rev=511716&r1=511715&r2=511716
==============================================================================
--- tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/servlets/DefaultServlet.java (original)
+++ tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/servlets/DefaultServlet.java Sun Feb 25 20:06:07 2007
@@ -1649,7 +1649,7 @@
                 // If an If-None-Match header has been specified, if modified since
                 // is ignored.
                 if ((request.getHeader("If-None-Match") == null)
-                    && (lastModified <= headerValue + 1000)) {
+                    && (lastModified < headerValue + 1000)) {
                     // The entity has not been modified since the date
                     // specified by the client. This is not an error case.
                     response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
@@ -1740,7 +1740,7 @@
             long lastModified = resourceAttributes.getLastModified();
             long headerValue = request.getDateHeader("If-Unmodified-Since");
             if (headerValue != -1) {
-                if ( lastModified > (headerValue + 1000)) {
+                if ( lastModified >= (headerValue + 1000)) {
                     // The entity has not been modified since the date
                     // specified by the client. This is not an error case.
                     response.sendError(HttpServletResponse.SC_PRECONDITION_FAILED);

Modified: tomcat/container/tc5.5.x/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/webapps/docs/changelog.xml?view=diff&rev=511716&r1=511715&r2=511716
==============================================================================
--- tomcat/container/tc5.5.x/webapps/docs/changelog.xml (original)
+++ tomcat/container/tc5.5.x/webapps/docs/changelog.xml Sun Feb 25 20:06:07 2007
@@ -22,6 +22,11 @@
         throws an exception. (markt)
       </fix>
       <fix>
+        <bug>41666</bug> Correct handling of boundary conditions for
+        If-Unmodified-Since and If-Modified-Since headers. Patch provided by
+        Suzuki Yuichiro. (markt)
+      </fix>
+      <fix>
         <bug>41674</bug> Fix error messages when parsing context.xml that
         incorrectly referred to web.xml. (markt)
       </fix>



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