diff options
author | Aliaksandr Valialkin <valyala@gmail.com> | 2015-11-04 19:02:49 +0200 |
---|---|---|
committer | Aliaksandr Valialkin <valyala@gmail.com> | 2015-11-04 19:02:49 +0200 |
commit | 4a823fa707a174ad03a577ee471bb486e2e51619 (patch) | |
tree | e76791f650f0bee17a0bcc4f91788ca21ac0da15 /cookie_test.go | |
parent | Added functions for obtaining cookie values from RequestHeader (diff) | |
download | fasthttp-4a823fa707a174ad03a577ee471bb486e2e51619.tar.gz fasthttp-4a823fa707a174ad03a577ee471bb486e2e51619.tar.bz2 fasthttp-4a823fa707a174ad03a577ee471bb486e2e51619.zip |
Properly encode cookie without name
Diffstat (limited to 'cookie_test.go')
-rw-r--r-- | cookie_test.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/cookie_test.go b/cookie_test.go index 00c1306..12bec57 100644 --- a/cookie_test.go +++ b/cookie_test.go @@ -8,11 +8,11 @@ import ( func TestParseCookies(t *testing.T) { testParseCookies(t, "", "") testParseCookies(t, "=", "") - testParseCookies(t, "foo", "=foo") - testParseCookies(t, "=foo", "=foo") + testParseCookies(t, "foo", "foo") + testParseCookies(t, "=foo", "foo") testParseCookies(t, "bar=", "bar=") - testParseCookies(t, "xxx=aa;bb=c; d; ;;e=g", "xxx=aa; bb=c; =d; e=g") - testParseCookies(t, "a;b;c; d=1;d=2", "=c; d=2") + testParseCookies(t, "xxx=aa;bb=c; =d; ;;e=g", "xxx=aa; bb=c; d; e=g") + testParseCookies(t, "a;b;c; d=1;d=2", "c; d=2") testParseCookies(t, " %D0%B8%D0%B2%D0%B5%D1%82=a%20b%3Bc ;s%20s=aaa ", "%D0%B8%D0%B2%D0%B5%D1%82=a%20b%3Bc; s%20s=aaa") } @@ -26,9 +26,9 @@ func testParseCookies(t *testing.T, s, expectedS string) { } func TestAppendCookieBytes(t *testing.T) { - testAppendCookieBytes(t, "=", "=") + testAppendCookieBytes(t, "=", "") testAppendCookieBytes(t, "foo=", "foo=") - testAppendCookieBytes(t, "=bar", "=bar") + testAppendCookieBytes(t, "=bar", "bar") testAppendCookieBytes(t, "привет=a b;c&s s=aaa", "%D0%BF%D1%80%D0%B8%D0%B2%D0%B5%D1%82=a%20b%3Bc; s%20s=aaa") } |