Settings

Theme

Passenger date header was incorrectly formatted as week-based year

github.com

9 points by 5vforest 12 years ago · 5 comments

Reader

FooBarWidget 12 years ago

I'm a developer at Phusion.

Thanks everyone for letting us know. We're working on rolling out a new release right now. A new gem, tarball and binaries are coming up.

In the mean time, you can work around this problem by setting a Date header from your application. For example in Rails you can do:

    before_filter { response.date = Time.now.utc }
5vforestOP 12 years ago

> Passenger sometimes gets the date wrong when appending the http Date header to responses. This happens when the week-based year differs from the calendar year. It happens because it uses %G to print the year when it should be using %Y (see this commit: 15ed1d4).

Took me a few hours to track this down -- and it's probably affecting a large majority of the Rails apps that are using a Passenger server.

Hopefully getting the word out can save some folks a few hours of banging their heads on their desks.

edavis 12 years ago

Anybody know why %G was used instead of %Y?

  • FooBarWidget 12 years ago

    Mea culpa. I was looking for a formatter that would always format the year as 4 digits and never as 2, regardless of locale. But I didn't read the documentation correctly and thought that %G was what I needed.

    • edavis 12 years ago

      Gotcha. I don't use Rails and wasn't trying to rub salt in, it just seemed like there must have been a reason %G was used instead of %Y and I was curious.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection