Permalink
Browse files

Force US locale for parsing HTTP dates

  • Loading branch information...
1 parent 06c91ce commit a03d2a7c4f9b43436eb8649316244920aa263e5f @weavejester weavejester committed Jul 3, 2010
Showing with 2 additions and 3 deletions.
  1. +2 −3 ring-core/src/ring/middleware/file_info.clj
View
5 ring-core/src/ring/middleware/file_info.clj
@@ -3,8 +3,7 @@
(:use [clojure.contrib.def :only (defvar-)]
ring.util.response)
(:import java.io.File
- java.util.Date
- java.util.TimeZone
+ [java.util Date Locale TimeZone]
java.text.SimpleDateFormat))
(defvar- base-mime-types
@@ -78,7 +77,7 @@
"Formats or parses dates into HTTP date format (RFC 822/1123)."
[]
;; SimpleDateFormat is not threadsafe, so return a new instance each time
- (doto (SimpleDateFormat. "EEE, dd MMM yyyy HH:mm:ss ZZZ")
+ (doto (SimpleDateFormat. "EEE, dd MMM yyyy HH:mm:ss ZZZ" Locale/US)
(.setTimeZone (TimeZone/getTimeZone "UTC"))))
(defn- not-modified-since?

0 comments on commit a03d2a7

Please sign in to comment.