Skip to content
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

net/http: support cookie names with colon #12698

Closed
kayrus opened this issue Sep 19, 2015 · 5 comments
Closed

net/http: support cookie names with colon #12698

kayrus opened this issue Sep 19, 2015 · 5 comments

Comments

@kayrus
Copy link

kayrus commented Sep 19, 2015

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:

diff --git a/src/net/http/lex.go b/src/net/http/lex.go
index 50b14f8..1e6f3fa 100644
--- a/src/net/http/lex.go
+++ b/src/net/http/lex.go
@@ -32,6 +32,7 @@ var isTokenTable = [127]bool{
        '7':  true,
        '8':  true,
        '9':  true,
+       ':':  true,
        'A':  true,
        'B':  true,
        'C':  true,
@minux
Copy link
Member

minux commented Sep 19, 2015 via email

@minux minux closed this as completed Sep 19, 2015
@kayrus
Copy link
Author

kayrus commented Sep 19, 2015

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?

@minux minux changed the title net/http: support cookie names with comma net/http: support cookie names with colon Sep 19, 2015
@minux
Copy link
Member

minux commented Sep 19, 2015 via email

@kayrus
Copy link
Author

kayrus commented Sep 20, 2015

It is not possible when you have several redirects.

@StalkR
Copy link

StalkR commented Sep 25, 2015

@kayrus you can if you work at transport level, see http://godoc.org/github.com/StalkR/misc/net/http/spacecookies for example

@golang golang locked and limited conversation to collaborators Sep 27, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants