Don't normalize cookie names to lower-case.

db4
Doug Coleman 2011-02-10 21:09:20 -06:00
parent 4270c6cce6
commit 02ecc45165
3 changed files with 7 additions and 3 deletions

View File

@ -108,7 +108,7 @@ TUPLE: cookie name value version comment path domain expires max-age http-only s
: (unparse-cookie) ( cookie -- strings )
[
dup name>> check-cookie-string >lower
dup name>> check-cookie-string
over value>> check-cookie-value unparse-cookie-value
"$path" over path>> unparse-cookie-value
"$domain" over domain>> unparse-cookie-value
@ -120,7 +120,7 @@ TUPLE: cookie name value version comment path domain expires max-age http-only s
: unparse-set-cookie ( cookie -- string )
[
dup name>> check-cookie-string >lower
dup name>> check-cookie-string
over value>> check-cookie-value unparse-cookie-value
"path" over path>> unparse-cookie-value
"domain" over domain>> unparse-cookie-value

View File

@ -11,6 +11,10 @@ IN: http.parsers.tests
[ "__s=12345567" parse-cookie ]
unit-test
[ { T{ cookie { name "CaseSensitive" } { value "aBc" } } } ]
[ "CaseSensitive=aBc" parse-cookie ]
unit-test
[ { T{ cookie { name "__s" } { value "12345567" } } } ]
[ "__s=12345567;" parse-cookie ]
unit-test

View File

@ -135,7 +135,7 @@ PEG: parse-header-line ( string -- pair )
2choice case-sensitive ;
: 'attr' ( -- parser )
'token' case-insensitive ;
'token' case-sensitive ;
: 'av-pair' ( -- parser )
[