Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug when passing utc timestamps into httpd_util:rfc1123/1. #776

Merged
merged 1 commit into from
Feb 26, 2018

Conversation

martincox
Copy link
Contributor

This function expects a localtime and throws an exception otherwise. This is evident when the clocks go forward for DST and a time falling in the skipped hour is passed into the function.

The fact that an exception is thrown is down to a bug in OTP which was patched in 20.1.

…unction

expects a localtime and throws an exception otherwise. This is evident when
the clocks go forward for DST and a time falling in the skipped hour is passed
into the function.

The fact that an exception is thrown is down to a bug in OTP which was patched
in 20.1.
@martincox
Copy link
Contributor Author

@russelldb @Vagabond @binarytemple-external needs a quick review / merge if anyone can spare a couple of mins?

@ghost
Copy link

ghost commented Feb 21, 2018

I don't have review rights, but I'll give it a +1

5> httpd_util:rfc1123_date(calendar:universal_time_to_local_time(DateTime)).
"Mon, 01 Jan 2018 00:00:00 GMT"
6> f(DateTime).                
ok
7> DateTime = {{2013, 9, 19}, {20, 51, 7}}.                                 
{{2013,9,19},{20,51,7}}
8> httpd_util:rfc1123_date(calendar:universal_time_to_local_time(DateTime)).
"Thu, 19 Sep 2013 20:51:07 GMT"

I guess from your commit message we can dump it later when everything is running on 20.2+ but that's the future, better to think in the present.

@ghost
Copy link

ghost commented Feb 21, 2018

fixes #775

Copy link
Member

@russelldb russelldb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM +1

@martincox martincox merged commit 55943f8 into develop-2.2 Feb 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants