[go] net/http: the Set-Cookie Expiration time zone should be GMT, not UTC

488 views
Skip to first unread message

Brad Fitzpatrick (Gerrit)

unread,
Jun 4, 2015, 3:59:18 PM6/4/15
to Ian Lance Taylor, Brad Fitzpatrick, golang-co...@googlegroups.com
Brad Fitzpatrick uploaded a change:
https://go-review.googlesource.com/10711

net/http: the Set-Cookie Expiration time zone should be GMT, not UTC

Per RFC 6265.

Change-Id: I2b6b145f5d057f96509332509d722602ed9e2bbd
---
M src/net/http/cookie.go
M src/net/http/cookie_test.go
2 files changed, 5 insertions(+), 1 deletion(-)



diff --git a/src/net/http/cookie.go b/src/net/http/cookie.go
index a0d0fdb..635a265 100644
--- a/src/net/http/cookie.go
+++ b/src/net/http/cookie.go
@@ -156,7 +156,7 @@
}
}
if c.Expires.Unix() > 0 {
- fmt.Fprintf(&b, "; Expires=%s", c.Expires.UTC().Format(time.RFC1123))
+ fmt.Fprintf(&b, "; Expires=%s", c.Expires.UTC().Format(TimeFormat))
}
if c.MaxAge > 0 {
fmt.Fprintf(&b, "; Max-Age=%d", c.MaxAge)
diff --git a/src/net/http/cookie_test.go b/src/net/http/cookie_test.go
index 1ec993e..bcad88c 100644
--- a/src/net/http/cookie_test.go
+++ b/src/net/http/cookie_test.go
@@ -52,6 +52,10 @@
&Cookie{Name: "cookie-8", Value: "eight", Domain: "::1"},
"cookie-8=eight",
},
+ {
+ &Cookie{Name: "cookie-9", Value: "expiring", Expires:
time.Unix(1257894000, 0)},
+ "cookie-9=expiring; Expires=Tue, 10 Nov 2009 23:00:00 GMT",
+ },
// The "special" cookies have values containing commas or spaces which
// are disallowed by RFC 6265 but are common in the wild.
{

--
https://go-review.googlesource.com/10711

Andrew Gerrand (Gerrit)

unread,
Jun 4, 2015, 4:05:45 PM6/4/15
to Brad Fitzpatrick, Brett Slatkin, golang-co...@googlegroups.com
Andrew Gerrand has posted comments on this change.

net/http: the Set-Cookie Expiration time zone should be GMT, not UTC

Patch Set 1: Code-Review+2

I was in greenwich recently; nice place.

--
https://go-review.googlesource.com/10711
Gerrit-Reviewer: Andrew Gerrand <a...@golang.org>
Gerrit-Reviewer: Brett Slatkin <bsla...@google.com>
Gerrit-HasComments: No

Brad Fitzpatrick (Gerrit)

unread,
Jun 4, 2015, 4:07:42 PM6/4/15
to Brad Fitzpatrick, Andrew Gerrand, Brett Slatkin, golang-co...@googlegroups.com
Brad Fitzpatrick has posted comments on this change.

net/http: the Set-Cookie Expiration time zone should be GMT, not UTC

Patch Set 1: Run-TryBot+1

--
https://go-review.googlesource.com/10711
Gerrit-Reviewer: Andrew Gerrand <a...@golang.org>
Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>

Gobot Gobot (Gerrit)

unread,
Jun 4, 2015, 4:08:36 PM6/4/15
to Brad Fitzpatrick, Andrew Gerrand, Brett Slatkin, golang-co...@googlegroups.com
Gobot Gobot has posted comments on this change.

net/http: the Set-Cookie Expiration time zone should be GMT, not UTC

Patch Set 1:

TryBots beginning. Status page: http://farmer.golang.org/try?commit=e75943a9

--
https://go-review.googlesource.com/10711
Gerrit-Reviewer: Andrew Gerrand <a...@golang.org>
Gerrit-Reviewer: Brad Fitzpatrick <brad...@golang.org>
Gerrit-Reviewer: Brett Slatkin <bsla...@google.com>
Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
Gerrit-HasComments: No

Brad Fitzpatrick (Gerrit)

unread,
Jun 4, 2015, 4:41:57 PM6/4/15
to Brad Fitzpatrick, golang-...@googlegroups.com, Andrew Gerrand, Brett Slatkin, Gobot Gobot, golang-co...@googlegroups.com
Brad Fitzpatrick has submitted this change and it was merged.

net/http: the Set-Cookie Expiration time zone should be GMT, not UTC

Per RFC 6265.

Change-Id: I2b6b145f5d057f96509332509d722602ed9e2bbd
Reviewed-on: https://go-review.googlesource.com/10711
Reviewed-by: Brett Slatkin <bsla...@google.com>
Reviewed-by: Andrew Gerrand <a...@golang.org>
Run-TryBot: Brad Fitzpatrick <brad...@golang.org>
---
M src/net/http/cookie.go
M src/net/http/cookie_test.go
2 files changed, 5 insertions(+), 1 deletion(-)

Approvals:
Brad Fitzpatrick: Run TryBots
Brett Slatkin: Looks good to me, but someone else must approve
Andrew Gerrand: Looks good to me, approved

Brett Slatkin (Gerrit)

unread,
Jun 4, 2015, 5:26:54 PM6/4/15
to Brad Fitzpatrick, golang-co...@googlegroups.com
Brett Slatkin has posted comments on this change.

net/http: the Set-Cookie Expiration time zone should be GMT, not UTC

Patch Set 1: Code-Review+1

--
https://go-review.googlesource.com/10711
Reply all
Reply to author
Forward
0 new messages