-
-
Notifications
You must be signed in to change notification settings - Fork 989
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
Use timestamps in GMT format per RFC2616 #772
Conversation
…FC1123` while formatting expires header
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any benefit to switching to a GMT (UTC) format? Can you point us at any RFC?
middleware/nocache.go
Outdated
@@ -9,7 +9,7 @@ import ( | |||
) | |||
|
|||
// Unix epoch time | |||
var epoch = time.Unix(0, 0).Format(time.RFC1123) | |||
var epoch = time.Unix(0, 0).Format(http.TimeFormat) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://pkg.go.dev/net/http#TimeFormat
"The time being formatted must be in UTC for Format to generate the correct format."
This is not correct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry my bad, fixed in recent commit
here is the rfc that all http date must be represented in GMT |
also here , GMT in format was represent the time was UTC |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
it seems http.TimeFormat used to format time that related with http header, and nocache middleware was not use that(time.RFC1123 instead)