Author: kkolinko
Date: Thu Dec  6 14:25:28 2012
New Revision: 1417903

URL: http://svn.apache.org/viewvc?rev=1417903&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=54087
Ignore invalid If-Modified-Since header as per RFC2616-14.25.a
Backport of markt's patch from Tomcat 7

Modified:
    tomcat/tc6.0.x/trunk/STATUS.txt
    tomcat/tc6.0.x/trunk/java/javax/servlet/http/HttpServlet.java
    tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=1417903&r1=1417902&r2=1417903&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Thu Dec  6 14:25:28 2012
@@ -94,14 +94,6 @@ PATCHES PROPOSED TO BACKPORT:
   +1: kkolinko
   -1:
 
-* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=54087
-  Correctly handle (ignore) invalid If-Modified-Since
-  header rather than throwing an exception.
-  http://svn.apache.org/viewvc?view=revision&revision=1408254
-  (r1408248 in trunk, by markt)
-  +1: kkolinko, kfujino, schultz
-  -1:
-
 * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=54220
   ErrorReportValve invoked on non-error responses
   http://svn.apache.org/viewvc?rev=1416537&view=rev (ErrorReportValve.java 
only)

Modified: tomcat/tc6.0.x/trunk/java/javax/servlet/http/HttpServlet.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/javax/servlet/http/HttpServlet.java?rev=1417903&r1=1417902&r2=1417903&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/javax/servlet/http/HttpServlet.java (original)
+++ tomcat/tc6.0.x/trunk/java/javax/servlet/http/HttpServlet.java Thu Dec  6 
14:25:28 2012
@@ -616,7 +616,13 @@ public abstract class HttpServlet extend
                 // to go through further expensive logic
                 doGet(req, resp);
             } else {
-                long ifModifiedSince = req.getDateHeader(HEADER_IFMODSINCE);
+                long ifModifiedSince;
+                try {
+                    ifModifiedSince = req.getDateHeader(HEADER_IFMODSINCE);
+                } catch (IllegalArgumentException iae) {
+                    // Invalid date header - proceed as if none was set
+                    ifModifiedSince = -1;
+                }
                 if (ifModifiedSince < (lastModified / 1000 * 1000)) {
                     // If the servlet mod time is later, call doGet()
                     // Round down to the nearest second for a proper compare

Modified: tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml?rev=1417903&r1=1417902&r2=1417903&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Thu Dec  6 14:25:28 2012
@@ -54,6 +54,10 @@
         <bug>54054</bug>: Do not share shell environment variables between
         multiple instances of the CGI servlet. (markt)
       </fix>
+      <fix>
+        <bug>54087</bug>: Correctly handle (ignore) invalid If-Modified-Since
+        header rather than throwing an exception. (markt/kkolinko)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Web applications">



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

Reply via email to