Port fix for bug 41666. Correct handling of boundary conditions for If-Unmodified...
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sat, 3 Mar 2007 16:03:11 +0000 (16:03 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sat, 3 Mar 2007 16:03:11 +0000 (16:03 +0000)
Update changelog.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@514179 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/servlets/DefaultServlet.java
webapps/docs/changelog.xml

index 8afbaaf..ba61435 100644 (file)
@@ -1567,7 +1567,7 @@ public class DefaultServlet
                 // 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);
@@ -1658,7 +1658,7 @@ public class DefaultServlet
             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);
index cfd3bd1..d068f77 100644 (file)
   <subsection name="Catalina">
     <changelog>
       <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>41739</bug> Correct handling of servlets with a load-on-startup
         value of zero. These are now the first servlets to be started. (markt)
       </fix>
@@ -33,6 +38,9 @@
         when the serviet is reading/writing from the input/output streams
         The flag is <code>-Dorg.apache.tomcat.util.net.NioSelectorShared=true</code>
       </update>
+      <fix>
+        Requests with multiple content-length headers are now rejected. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Webapps">