File tree Expand file tree Collapse file tree 2 files changed +1
-3
lines changed Expand file tree Collapse file tree 2 files changed +1
-3
lines changed Original file line number Diff line number Diff line change @@ -459,9 +459,6 @@ func sanitizeCookieName(n string) string {
459
459
// See https://golang.org/issue/7243 for the discussion.
460
460
func sanitizeCookieValue (v string , quoted bool ) string {
461
461
v = sanitizeOrWarn ("Cookie.Value" , validCookieValueByte , v )
462
- if len (v ) == 0 {
463
- return v
464
- }
465
462
if strings .ContainsAny (v , " ," ) || quoted {
466
463
return `"` + v + `"`
467
464
}
Original file line number Diff line number Diff line change @@ -530,6 +530,7 @@ func TestCookieSanitizeValue(t *testing.T) {
530
530
{"a,z" , false , `"a,z"` },
531
531
{",z" , false , `",z"` },
532
532
{"a," , false , `"a,"` },
533
+ {"" , true , `""` },
533
534
}
534
535
for _ , tt := range tests {
535
536
if got := sanitizeCookieValue (tt .in , tt .quoted ); got != tt .want {
You can’t perform that action at this time.
0 commit comments