Fixing cookie regex

This commit is contained in:
Jay McCarthy 2010-04-27 08:48:07 -06:00
parent 67d804af62
commit 96a3f47ea0
2 changed files with 19 additions and 8 deletions

View File

@ -255,7 +255,7 @@
;; appear as a block to be legal, and " may only appear as \"
(define (rfc2068:quoted-string? s)
(and (regexp-match?
#rx"^\"([^\"#\u0000-#\u001F]| |#\return#\newline|#\tab|\\\\\")*\"$"
#rx"^\"([^\"\u0000-\u001F]| |\r\n|\t|\\\\\")*\"$"
s)
s))

View File

@ -79,6 +79,17 @@
(cookie-error-test (RC cookie:add-domain "bad domain.com"))
(cookie-error-test (RC cookie:add-domain ".bad-domain;com")))
; cookie value
(test
(cookie-value? "value")
(cookie-value? "(")
(cookie-value? "!")
(cookie-value? ")")
(cookie-value? ")!")
(cookie-value? "(!")
(cookie-value? "(!)")
(cookie-value? "!)"))
)
(test do (tests)))