You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In net/http, before cookies are read, they are checked to ensure they have a valid name. However, when setting a cookie, an invalid name may be used; rather than being permitted, this should trigger an error.
There is further discussion on the gorilla sessions topic in which it was suggested that I raise this possibility here.
To answer the questions in the guidelines:
What version of Go are you using (go version)? 1.4
What operating system and processor architecture are you using? OS X 64-bit
What did you do? Created a cookie with an empty name (or spaces, or other invalid characters) and set it in a way that was seemingly successful.
What did you expect to see? I expected to see an error.
What did you see instead? I saw my cookie get set, but I could not read it (as its name is invalid, and correctly filtered out on the reading end of things).
The text was updated successfully, but these errors were encountered:
mikioh
changed the title
net/http should reject setting cookies with invalid names
net/http: should reject setting cookies with invalid names
Feb 3, 2015
Your point is well taken. Documentation would be valuable - and I wonder if a signature change for 2.0 could be considered (if I am correctly recalling the go compatibility guarantees)?
In net/http, before cookies are read, they are checked to ensure they have a valid name. However, when setting a cookie, an invalid name may be used; rather than being permitted, this should trigger an error.
There is further discussion on the gorilla sessions topic in which it was suggested that I raise this possibility here.
To answer the questions in the guidelines:
What version of Go are you using (go version)? 1.4
What operating system and processor architecture are you using? OS X 64-bit
What did you do? Created a cookie with an empty name (or spaces, or other invalid characters) and set it in a way that was seemingly successful.
What did you expect to see? I expected to see an error.
What did you see instead? I saw my cookie get set, but I could not read it (as its name is invalid, and correctly filtered out on the reading end of things).
The text was updated successfully, but these errors were encountered: