]> gitweb.factorcode.org Git - factor.git/commitdiff
Don't normalize cookie names to lower-case.
authorDoug Coleman <doug.coleman@gmail.com>
Fri, 11 Feb 2011 03:09:20 +0000 (21:09 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Fri, 11 Feb 2011 03:09:20 +0000 (21:09 -0600)
basis/http/http.factor
basis/http/parsers/parsers-tests.factor
basis/http/parsers/parsers.factor

index 46b67b53216e76f313a54745907eb212baa1117b..2030b0d825129cff79e346230ddf8b474abbd914 100644 (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
index f8c3b836a6e7d0eb4f7590ab81c22eddc49d1253..438f15a7a318609a1f47d45797c0542ce16f22ab 100644 (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
index 1a8023681744b17df010579ede78d55187774b18..9c81510925bd5ca31508052222f27255edf04600 100644 (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 )
     [