From a1d7945958c5b876b45594b75236857ae9d3608d Mon Sep 17 00:00:00 2001 From: Jay McCarthy Date: Tue, 12 Jan 2010 21:51:35 +0000 Subject: [PATCH] PR10689 svn: r17621 --- collects/tests/web-server/http/cookies-test.ss | 16 ++++++++++++++++ collects/web-server/http/cookie-parse.ss | 11 ++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/collects/tests/web-server/http/cookies-test.ss b/collects/tests/web-server/http/cookies-test.ss index f3b4bac32a..e41f7c5e55 100644 --- a/collects/tests/web-server/http/cookies-test.ss +++ b/collects/tests/web-server/http/cookies-test.ss @@ -126,4 +126,20 @@ (list (make-client-cookie "key1" "value1" #f "/acme") (make-client-cookie "key2" "value2" ".acme" #f))) + (test-equal? "phpBB. PR10689" + (request-cookies + (make-request + #"GET" (string->url "http://test.com/foo") + (list (make-header #"Cookie" + #"style_cookie=null; phpbb3_e1p9b_u=54; phpbb3_e1p9b_k=; phpbb3_e1p9b_sid=3fa8d7a7b65fbabcbe9b345861dc079a")) + empty #f + "host" 80 "client")) + (list (make-client-cookie "style_cookie" "null" #f #f) + (make-client-cookie "phpbb3_e1p9b_u" "54" #f #f) + (make-client-cookie "phpbb3_e1p9b_k" "" #f #f) + (make-client-cookie "phpbb3_e1p9b_sid" "3fa8d7a7b65fbabcbe9b345861dc079a" #f #f))) + ))) + +#;(require schemeunit/text-ui) +#;(run-tests cookies-tests) \ No newline at end of file diff --git a/collects/web-server/http/cookie-parse.ss b/collects/web-server/http/cookie-parse.ss index 8983ce9f1b..afd0635bdd 100644 --- a/collects/web-server/http/cookie-parse.ss +++ b/collects/web-server/http/cookie-parse.ss @@ -32,6 +32,13 @@ VALUE = value path = "$Path" "=" value domain = "$Domain" "=" value + + value = token | quoted-string + + token = 1* + + quoted-string = ( <"> *(qdtext) <"> ) + qdtext = > |# (define-lex-abbrevs (tspecial (:or (char-set "()<>@,;:\\\"/[]?={}") whitespace #\tab)) @@ -74,7 +81,9 @@ (separator [(COMMA) #t] [(SEMI) #t]) - (item [(lhs EQUALS rhs) (cons $1 $3)]) + (item [(lhs EQUALS rhs) (cons $1 $3)] + ; This is not part of the spec. It is illegal + [(lhs EQUALS) (cons $1 "")]) (lhs [(DOMAIN) 'domain] [(PATH) 'path] [(TOKEN) $1])