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 2012/11/12 12:32:27 UTC
svn commit: r1408248 - /tomcat/trunk/java/javax/servlet/http/HttpServlet.java
Author: markt
Date: Mon Nov 12 11:32:26 2012
New Revision: 1408248
URL: http://svn.apache.org/viewvc?rev=1408248&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
Modified:
tomcat/trunk/java/javax/servlet/http/HttpServlet.java
Modified: tomcat/trunk/java/javax/servlet/http/HttpServlet.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/http/HttpServlet.java?rev=1408248&r1=1408247&r2=1408248&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/http/HttpServlet.java (original)
+++ tomcat/trunk/java/javax/servlet/http/HttpServlet.java Mon Nov 12 11:32:26 2012
@@ -620,7 +620,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
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org