Commit 07ccdeb1 authored by Brave Cow's avatar Brave Cow Committed by Brad Fitzpatrick

net/http: update sanitizeCookieValue description

Commit 8f6d68eb (CL 37328) changed the code of sanitizeCookieValue without updating its description.

Change-Id: Ib4a1a1f316548258b828458a31b09706bbd59b53
GitHub-Last-Rev: 9731494e177d909f33dd7d5ecfe1fd1a1c88a3e1
GitHub-Pull-Request: golang/go#34790
Reviewed-on: https://go-review.googlesource.com/c/go/+/200041Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent ea726d8d
...@@ -353,6 +353,7 @@ func sanitizeCookieName(n string) string { ...@@ -353,6 +353,7 @@ func sanitizeCookieName(n string) string {
return cookieNameSanitizer.Replace(n) return cookieNameSanitizer.Replace(n)
} }
// sanitizeCookieValue produces a suitable cookie-value from v.
// https://tools.ietf.org/html/rfc6265#section-4.1.1 // https://tools.ietf.org/html/rfc6265#section-4.1.1
// cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE ) // cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )
// cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E // cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E
...@@ -360,8 +361,8 @@ func sanitizeCookieName(n string) string { ...@@ -360,8 +361,8 @@ func sanitizeCookieName(n string) string {
// ; whitespace DQUOTE, comma, semicolon, // ; whitespace DQUOTE, comma, semicolon,
// ; and backslash // ; and backslash
// We loosen this as spaces and commas are common in cookie values // We loosen this as spaces and commas are common in cookie values
// but we produce a quoted cookie-value in when value starts or ends // but we produce a quoted cookie-value if and only if v contains
// with a comma or space. // commas or spaces.
// See https://golang.org/issue/7243 for the discussion. // See https://golang.org/issue/7243 for the discussion.
func sanitizeCookieValue(v string) string { func sanitizeCookieValue(v string) string {
v = sanitizeOrWarn("Cookie.Value", validCookieValueByte, v) v = sanitizeOrWarn("Cookie.Value", validCookieValueByte, v)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment