felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kgil...@apache.org
Subject svn commit: r1423137 - in /felix/trunk/httplite/core/src/main/java/org/apache/felix/httplite/servlet: HttpConstants.java HttpServletRequestImpl.java
Date Mon, 17 Dec 2012 20:47:54 GMT
Author: kgilmer
Date: Mon Dec 17 20:47:53 2012
New Revision: 1423137

URL: http://svn.apache.org/viewvc?rev=1423137&view=rev
Log:
Fix date parsing code in HttpServletRequestImpl to parse HTTP-specified format.  Fixes issue
with Web Console.

Modified:
    felix/trunk/httplite/core/src/main/java/org/apache/felix/httplite/servlet/HttpConstants.java
    felix/trunk/httplite/core/src/main/java/org/apache/felix/httplite/servlet/HttpServletRequestImpl.java

Modified: felix/trunk/httplite/core/src/main/java/org/apache/felix/httplite/servlet/HttpConstants.java
URL: http://svn.apache.org/viewvc/felix/trunk/httplite/core/src/main/java/org/apache/felix/httplite/servlet/HttpConstants.java?rev=1423137&r1=1423136&r2=1423137&view=diff
==============================================================================
--- felix/trunk/httplite/core/src/main/java/org/apache/felix/httplite/servlet/HttpConstants.java
(original)
+++ felix/trunk/httplite/core/src/main/java/org/apache/felix/httplite/servlet/HttpConstants.java
Mon Dec 17 20:47:53 2012
@@ -111,7 +111,7 @@ public class HttpConstants
     /**
      * Date format for HTTP
      */
-    public static final String HTTP_DATE_FORMAT = "EEE, d MMM yyyy HH:mm:ss z";
+    public static final String HTTP_DATE_FORMAT = "EEE, dd MMM yyyy HH:mm:ss zzz";
     /**
      * Timezone specified for HTTP
      */

Modified: felix/trunk/httplite/core/src/main/java/org/apache/felix/httplite/servlet/HttpServletRequestImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/httplite/core/src/main/java/org/apache/felix/httplite/servlet/HttpServletRequestImpl.java?rev=1423137&r1=1423136&r2=1423137&view=diff
==============================================================================
--- felix/trunk/httplite/core/src/main/java/org/apache/felix/httplite/servlet/HttpServletRequestImpl.java
(original)
+++ felix/trunk/httplite/core/src/main/java/org/apache/felix/httplite/servlet/HttpServletRequestImpl.java
Mon Dec 17 20:47:53 2012
@@ -42,6 +42,7 @@ import java.util.List;
 import java.util.Locale;
 import java.util.Map;
 import java.util.StringTokenizer;
+import java.util.TimeZone;
 
 import javax.servlet.RequestDispatcher;
 import javax.servlet.ServletInputStream;
@@ -820,8 +821,8 @@ public class HttpServletRequestImpl impl
 
         try
         {
-            SimpleDateFormat sdf = new SimpleDateFormat();
-
+            SimpleDateFormat sdf = new SimpleDateFormat(HttpConstants.HTTP_DATE_FORMAT);
+            sdf.setTimeZone(TimeZone.getTimeZone(HttpConstants.HTTP_TIMEZONE));
             return sdf.parse( headerValue ).getTime();
         }
         catch ( ParseException e )



Mime
View raw message