From 78de9c974e34ed84634ef70f595fa2f98e65f8b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Kie=C5=82basa?= Date: Wed, 27 Feb 2019 08:15:59 +0100 Subject: [PATCH] allows brackets in cookie name --- http/httpguts/httplex.go | 2 ++ http/httpguts/httplex_test.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/http/httpguts/httplex.go b/http/httpguts/httplex.go index e7de24ee6..3b8ab2d1e 100644 --- a/http/httpguts/httplex.go +++ b/http/httpguts/httplex.go @@ -14,6 +14,8 @@ import ( var isTokenTable = [127]bool{ '!': true, + '[': true, + ']': true, '#': true, '$': true, '%': true, diff --git a/http/httpguts/httplex_test.go b/http/httpguts/httplex_test.go index a2c57f392..2353cb538 100644 --- a/http/httpguts/httplex_test.go +++ b/http/httpguts/httplex_test.go @@ -14,7 +14,7 @@ func isCtl(c rune) bool { return c <= 31 || c == 127 } func isSeparator(c rune) bool { switch c { - case '(', ')', '<', '>', '@', ',', ';', ':', '\\', '"', '/', '[', ']', '?', '=', '{', '}', ' ', '\t': + case '(', ')', '<', '>', '@', ',', ';', ':', '\\', '"', '/', '?', '=', '{', '}', ' ', '\t': return true } return false