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

Comments

Projects
None yet
4 participants
@kayrus
Copy link

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

This comment has been minimized.

Copy link
Member

commented Sep 19, 2015

@minux minux closed this Sep 19, 2015

@kayrus

This comment has been minimized.

Copy link
Author

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

This comment has been minimized.

Copy link
Member

commented Sep 19, 2015

@kayrus

This comment has been minimized.

Copy link
Author

commented Sep 20, 2015

It is not possible when you have several redirects.

@StalkR

This comment has been minimized.

Copy link

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.
You can’t perform that action at this time.