commit | db49082bee7d91859a2c6e8891eed28f15dd75d7 | [log] [tgz] |
---|---|---|
author | Ken Gilmer <kgilmer@apache.org> | Mon Dec 17 20:47:53 2012 +0000 |
committer | Ken Gilmer <kgilmer@apache.org> | Mon Dec 17 20:47:53 2012 +0000 |
tree | ebf70a9f41d74fd3c48958cd2276b4c7db8cb286 | |
parent | bdb22231703726d0dca086ab115ae92285135eb5 [diff] |
Fix date parsing code in HttpServletRequestImpl to parse HTTP-specified format. Fixes issue with Web Console. git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1423137 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/httplite/core/src/main/java/org/apache/felix/httplite/servlet/HttpConstants.java b/httplite/core/src/main/java/org/apache/felix/httplite/servlet/HttpConstants.java index 940aac7..6dae42b 100644 --- a/httplite/core/src/main/java/org/apache/felix/httplite/servlet/HttpConstants.java +++ b/httplite/core/src/main/java/org/apache/felix/httplite/servlet/HttpConstants.java
@@ -111,7 +111,7 @@ /** * 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 */
diff --git a/httplite/core/src/main/java/org/apache/felix/httplite/servlet/HttpServletRequestImpl.java b/httplite/core/src/main/java/org/apache/felix/httplite/servlet/HttpServletRequestImpl.java index bde9584..ebd8609 100644 --- a/httplite/core/src/main/java/org/apache/felix/httplite/servlet/HttpServletRequestImpl.java +++ b/httplite/core/src/main/java/org/apache/felix/httplite/servlet/HttpServletRequestImpl.java
@@ -42,6 +42,7 @@ 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 @@ 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 )