ring-clojure / ring-clojure/ring

Last-Modified date format wrong in file-info namespace

Open
#245 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Clojure
Stars
3.9k
Forks
528
PR merge metrics
No merged PRs in 30d

Description

The date format in file_info.clj for static files: EEE, dd MMM yyyy HH:mm:ss ZZZ, is incorrect. ZZZ should be z. This makes an rfc 1123 standard date:

Wed, 08 Jun 2016 03:08:48 GMT

Also, set the timezone to GMT not UTC.

So the lines (in file_info.clj):

(doto (SimpleDateFormat. "EEE, dd MMM yyyy HH:mm:ss ZZZ" Locale/US)
    (.setTimeZone (TimeZone/getTimeZone "UTC"))))

should become:

(doto (SimpleDateFormat. "EEE, dd MMM yyyy HH:mm:ss z" Locale/US)
    (.setTimeZone (TimeZone/getTimeZone "GMT"))))

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open file_info.clj and inspect the SimpleDateFormat construction for static-file Last-Modified dates. Verify the requested RFC 1123 output, including the GMT timezone, and confirm the generated header matches the example date format.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure
Domain
backend
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.