Don't normalize cookie names to lower-case.
parent
4270c6cce6
commit
02ecc45165
|
@ -108,7 +108,7 @@ TUPLE: cookie name value version comment path domain expires max-age http-only s
|
||||||
|
|
||||||
: (unparse-cookie) ( cookie -- strings )
|
: (unparse-cookie) ( cookie -- strings )
|
||||||
[
|
[
|
||||||
dup name>> check-cookie-string >lower
|
dup name>> check-cookie-string
|
||||||
over value>> check-cookie-value unparse-cookie-value
|
over value>> check-cookie-value unparse-cookie-value
|
||||||
"$path" over path>> unparse-cookie-value
|
"$path" over path>> unparse-cookie-value
|
||||||
"$domain" over domain>> 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 )
|
: unparse-set-cookie ( cookie -- string )
|
||||||
[
|
[
|
||||||
dup name>> check-cookie-string >lower
|
dup name>> check-cookie-string
|
||||||
over value>> check-cookie-value unparse-cookie-value
|
over value>> check-cookie-value unparse-cookie-value
|
||||||
"path" over path>> unparse-cookie-value
|
"path" over path>> unparse-cookie-value
|
||||||
"domain" over domain>> unparse-cookie-value
|
"domain" over domain>> unparse-cookie-value
|
||||||
|
|
|
@ -11,6 +11,10 @@ IN: http.parsers.tests
|
||||||
[ "__s=12345567" parse-cookie ]
|
[ "__s=12345567" parse-cookie ]
|
||||||
unit-test
|
unit-test
|
||||||
|
|
||||||
|
[ { T{ cookie { name "CaseSensitive" } { value "aBc" } } } ]
|
||||||
|
[ "CaseSensitive=aBc" parse-cookie ]
|
||||||
|
unit-test
|
||||||
|
|
||||||
[ { T{ cookie { name "__s" } { value "12345567" } } } ]
|
[ { T{ cookie { name "__s" } { value "12345567" } } } ]
|
||||||
[ "__s=12345567;" parse-cookie ]
|
[ "__s=12345567;" parse-cookie ]
|
||||||
unit-test
|
unit-test
|
||||||
|
|
|
@ -135,7 +135,7 @@ PEG: parse-header-line ( string -- pair )
|
||||||
2choice case-sensitive ;
|
2choice case-sensitive ;
|
||||||
|
|
||||||
: 'attr' ( -- parser )
|
: 'attr' ( -- parser )
|
||||||
'token' case-insensitive ;
|
'token' case-sensitive ;
|
||||||
|
|
||||||
: 'av-pair' ( -- parser )
|
: 'av-pair' ( -- parser )
|
||||||
[
|
[
|
||||||
|
|
Loading…
Reference in New Issue