-
Notifications
You must be signed in to change notification settings - Fork 18k
net/http: support cookie names with colon #12698
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
Labels
Comments
Of course cookie names can't contain ':'.
http://tools.ietf.org/html/rfc6265#section-4.1.1 specifies that:
set-cookie-header = "Set-Cookie:" SP set-cookie-string
set-cookie-string = cookie-pair *( ";" SP cookie-av )
cookie-pair = cookie-name "=" cookie-value
cookie-name = token
Then in http://tools.ietf.org/html/rfc2616#section-2.2, token is
specified as:
token = 1*<any CHAR except CTLs or separators>
separators = "(" | ")" | "<" | ">" | "@"
| "," | ";" | ":" | "\" | <">
| "/" | "[" | "]" | "?" | "="
| "{" | "}" | SP | HT
Notice that ':' is one of the separators not allowed in token.
|
Ok, is there a way to avoid go source modification? Add something like exception? Why browsers parse commas inside cookie name but go doesn't? |
you can directly parse the Set-Cookie header.
related #11519.
|
It is not possible when you have several redirects. |
@kayrus you can if you work at transport level, see http://godoc.org/github.com/StalkR/misc/net/http/spacecookies for example |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
related to #7243
I've reviewed RFC 6265 but didn't find any statement that cookie value name should not contain comma.
I'm new to go and it was really hard to debug HTTPS (#12697) connection of site which uses commas in cookies' names. Quick fix looks like:
The text was updated successfully, but these errors were encountered: