From 66aac4fa94e7d64f0e670fd98168ca1339a174de Mon Sep 17 00:00:00 2001 From: yanando <40922266+yanando@users.noreply.github.com> Date: Tue, 5 Oct 2021 16:48:02 +0200 Subject: [PATCH] Should only strip double quotes if the "allowDoubleQuote" parameter is set to false --- cookie.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookie.go b/cookie.go index 7fe05826..653f2eea 100644 --- a/cookie.go +++ b/cookie.go @@ -419,7 +419,7 @@ func sanitizeOrWarn(fieldName string, valid func(byte) bool, v string) string { func parseCookieValue(raw string, allowDoubleQuote bool) (string, bool) { // Strip the quotes, if present. - if allowDoubleQuote && len(raw) > 1 && raw[0] == '"' && raw[len(raw)-1] == '"' { + if !allowDoubleQuote && len(raw) > 1 && raw[0] == '"' && raw[len(raw)-1] == '"' { raw = raw[1 : len(raw)-1] } for i := 0; i < len(raw); i++ {