]> Cypherpunks repositories - gostls13.git/commit
net/http: send more cookie values in double quotes
authorVolker Dobler <dr.volker.dobler@gmail.com>
Wed, 22 Feb 2017 13:40:17 +0000 (14:40 +0100)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 22 May 2017 19:13:51 +0000 (19:13 +0000)
commit8f6d68ebaa660c6db8a87d418e95f8c0d3a221e4
treef442a14108781b59737cd20f6d0c0a7a9604a11a
parent1611839b29a5447f3132e93f14c75b1639a34490
net/http: send more cookie values in double quotes

According to RFC 6255 a cookie value may contain neither spaces " "
nor commas ",". But browsers seem to handle these pretty well and such
values are not uncommon in the wild so we do allow spaces and commas
in cookie values too. Up to now we use the double-quoted wire format
only for cookie values with leading and/or trailing spaces and commas.
Values with internal spaces/commas are sent without the optional double
quotes. This seems to be a problem for some agents.

This CL changes the behaviour for cookie values with spaces or commas:
Such values are always sent in double quotes. This should not have
any impact on existing agents and the increases of data transmitted
is negligible.

Fixes #18627

Change-Id: I575a98d589e048aa39d976a3c984550daaca730a
Reviewed-on: https://go-review.googlesource.com/37328
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