]> Cypherpunks repositories - gostls13.git/commit
net/http: add support for SameSite option in http.Cookie
authorStephan Renatus <srenatus@chef.io>
Mon, 27 Nov 2017 11:41:10 +0000 (12:41 +0100)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 9 Jul 2018 19:58:29 +0000 (19:58 +0000)
commit3d5703babe9c5344252db3fb8e96f20cd036535a
tree9cebc822e60592dbde785bcb3fe3f390f1160f12
parent4da84adc0c55d92f20b761d24a6ec0508e55dc7c
net/http: add support for SameSite option in http.Cookie

The same-site cookie attribute prevents a cookie from being sent along with
cross-site requests. The main goal is mitigate the risk of cross-origin
information leakage and provides some protection against cross-site request
forgery attacks.

This change adds the option to http.Cookie so it can be stored and
passed to HTTP clients.

Spec: https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00

Fixes #15867

Based on
https://github.com/reedloden/go/commit/eb31a0f063c80058bbb3abff4ca09b3565985500
by Reed Loden <reed@hackerone.com>

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