Patch to cowboy_rest for when local time != UTC #282

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
@dbmercer
Contributor

dbmercer commented Oct 11, 2012

The If-Modified-Since and Last-Modified HTTP headers are in UTC, but cowboy_rest.erl is expecting the time returned by last_modified/1 to be in local time. (We know this because the Last-Modified header is assembled with httpd_util:rfc1123_date/1, which expects its argument in local time.) When comparing the If-Modified-Since time to last_modified, we therefore need to put them in the same timezone.

@essen

This comment has been minimized.

Show comment Hide comment
@essen

essen Oct 11, 2012

Member

Hey, what I want is to actually standardize everything on UTC and allow developers to not worry about the timezones unless seriously needed.

Member

essen commented Oct 11, 2012

Hey, what I want is to actually standardize everything on UTC and allow developers to not worry about the timezones unless seriously needed.

@dbmercer

This comment has been minimized.

Show comment Hide comment
@dbmercer

dbmercer Oct 12, 2012

Contributor

I can change cowboy_static to pass in the file time in UTC, in fact that's
what I initially did, until I realized that the last-modified header was
expecting local time. I didn't want to mess with the interface too much, on
the off chance that someone was relying on the fact that it is local time
that's supposed to get passed in. However, if you think it's safe, I can
switch everything to UTC,
Do I uncommit this change (somehow), or do I just submit a new one, and a
new pull request?

On Oct 11, 2012, at 17:47, "Loïc Hoguin" notifications@github.com wrote:

Hey, what I want is to actually standardize everything on UTC and allow
developers to not worry about the timezones unless seriously needed.


Reply to this email directly or view it on
GitHubhttps://github.com/extend/cowboy/pull/282#issuecomment-9360985.

Contributor

dbmercer commented Oct 12, 2012

I can change cowboy_static to pass in the file time in UTC, in fact that's
what I initially did, until I realized that the last-modified header was
expecting local time. I didn't want to mess with the interface too much, on
the off chance that someone was relying on the fact that it is local time
that's supposed to get passed in. However, if you think it's safe, I can
switch everything to UTC,
Do I uncommit this change (somehow), or do I just submit a new one, and a
new pull request?

On Oct 11, 2012, at 17:47, "Loïc Hoguin" notifications@github.com wrote:

Hey, what I want is to actually standardize everything on UTC and allow
developers to not worry about the timezones unless seriously needed.


Reply to this email directly or view it on
GitHubhttps://github.com/extend/cowboy/pull/282#issuecomment-9360985.

@essen

This comment has been minimized.

Show comment Hide comment
@essen

essen Dec 1, 2012

Member

Hey, forgot to reply! Sorry.

If you are willing to switch all local time code (should be this, cookies has something, there's a function in cowboy_clock which expects local time too), then please do! Tell me otherwise I want to fix that shortly.

Thanks!

Member

essen commented Dec 1, 2012

Hey, forgot to reply! Sorry.

If you are willing to switch all local time code (should be this, cookies has something, there's a function in cowboy_clock which expects local time too), then please do! Tell me otherwise I want to fix that shortly.

Thanks!

@essen

This comment has been minimized.

Show comment Hide comment
@essen

essen Dec 3, 2012

Member

I'll start taking a look.

Member

essen commented Dec 3, 2012

I'll start taking a look.

@dbmercer

This comment has been minimized.

Show comment Hide comment
@dbmercer

dbmercer Dec 3, 2012

Contributor

Sorry, just got in on Monday morning. Sounds like you have more urgency than I have on this, so go for it. My main barrier is I have not yet figured out the GitHub workflow. Given enough time, I could figure it out, so it depends on how long you want to wait. I need to figure it out eventually.

Cheers,

DBM

From: Loïc Hoguin [mailto:notifications@github.com]
Sent: Monday, December 03, 2012 07:18
To: extend/cowboy
Cc: dbmercer
Subject: Re: [cowboy] Patch to cowboy_rest for when local time != UTC (#282)

I'll start taking a look.


Reply to this email directly or view it on GitHub extend#282 (comment) .

https://github.com/notifications/beacon/IjoQBKUvmlAnLgkmkaSo8o82vxuaq3HuLnmZteebmXuBvIbk5hQ9KdhWa0P4-paC.gif

Contributor

dbmercer commented Dec 3, 2012

Sorry, just got in on Monday morning. Sounds like you have more urgency than I have on this, so go for it. My main barrier is I have not yet figured out the GitHub workflow. Given enough time, I could figure it out, so it depends on how long you want to wait. I need to figure it out eventually.

Cheers,

DBM

From: Loïc Hoguin [mailto:notifications@github.com]
Sent: Monday, December 03, 2012 07:18
To: extend/cowboy
Cc: dbmercer
Subject: Re: [cowboy] Patch to cowboy_rest for when local time != UTC (#282)

I'll start taking a look.


Reply to this email directly or view it on GitHub extend#282 (comment) .

https://github.com/notifications/beacon/IjoQBKUvmlAnLgkmkaSo8o82vxuaq3HuLnmZteebmXuBvIbk5hQ9KdhWa0P4-paC.gif

@essen

This comment has been minimized.

Show comment Hide comment
@essen

essen Dec 3, 2012

Member

I just got annoyed with that code. I want GMT everywhere. :)

I'll probably take the opportunity to rewrite cookies.

Member

essen commented Dec 3, 2012

I just got annoyed with that code. I want GMT everywhere. :)

I'll probably take the opportunity to rewrite cookies.

@dvv

This comment has been minimized.

Show comment Hide comment
@dvv

dvv Dec 3, 2012

Contributor

+1 for GMT only

Contributor

dvv commented Dec 3, 2012

+1 for GMT only

@essen

This comment has been minimized.

Show comment Hide comment
@essen

essen Dec 6, 2012

Member

Almost done with that. Will push tomorrow.

Member

essen commented Dec 6, 2012

Almost done with that. Will push tomorrow.

@essen

This comment has been minimized.

Show comment Hide comment
@essen

essen Dec 7, 2012

Member

Should be good with 27da092. The REST part was done in #305.

Thanks!

Member

essen commented Dec 7, 2012

Should be good with 27da092. The REST part was done in #305.

Thanks!

@essen essen closed this Dec 7, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment