]> Cypherpunks repositories - gostls13.git/commit
net/http: fix cookie Expires minimum year to 1601 instead of Epoch year 1970
authorJosh Chorlton <jchorlton@gmail.com>
Thu, 27 Oct 2016 15:10:26 +0000 (23:10 +0800)
committerBrad Fitzpatrick <bradfitz@golang.org>
Fri, 28 Oct 2016 16:44:44 +0000 (16:44 +0000)
commitd86a6ef0c7e8307802c6cd3f623bade3e78a42bf
treeeee5f18811ba1541c5454ab257a2c9fc7541cbde
parenta8e86d99f18a72c8cbdedf5a47a9f7e93a87cd04
net/http: fix cookie Expires minimum year to 1601 instead of Epoch year 1970

Following RFC 6265 Section 5.1.1.5, ensure that the minimum
year for which an Expires value is valid and can be included in
the cookie's string, is 1601 instead of the Epoch year 1970.

A detailed specification for parsing the Expiry field is at:
https://tools.ietf.org/html/rfc6265#section-5.2.1

I stumbled across this bug due to this StackOverflow answer
that recommends setting the Expiry to the Epoch:
http://stackoverflow.com/a/5285982

Fixes #17632

Change-Id: I3c1bdf821d369320334a5dc1e4bf22783cbfe9fc
Reviewed-on: https://go-review.googlesource.com/32142
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/net/http/cookie.go
src/net/http/cookie_test.go