Stricter cookie contracts
svn: r18629 original commit: e69a18eefd90a336e7f4b8305485732ea5896727
This commit is contained in:
commit
3f01662a45
|
@ -1,5 +1,7 @@
|
||||||
#lang scheme/signature
|
#lang scheme/signature
|
||||||
|
|
||||||
|
cookie-name?
|
||||||
|
cookie-value?
|
||||||
cookie?
|
cookie?
|
||||||
valid-domain?
|
valid-domain?
|
||||||
set-cookie
|
set-cookie
|
||||||
|
|
|
@ -294,11 +294,12 @@
|
||||||
;;
|
;;
|
||||||
;; Returns whether this is a valid string to use as the value or the
|
;; Returns whether this is a valid string to use as the value or the
|
||||||
;; name (depending on value?) of an HTTP cookie.
|
;; name (depending on value?) of an HTTP cookie.
|
||||||
(define (cookie-string? s [value? #t])
|
(define (cookie-value? s)
|
||||||
(unless (string? s)
|
(and (string? s)
|
||||||
(error* "string expected, received: ~a" s))
|
(rfc2109:value? s)))
|
||||||
(if value?
|
|
||||||
(rfc2109:value? s)
|
(define (cookie-name? s)
|
||||||
|
(and (string? s)
|
||||||
;; name: token
|
;; name: token
|
||||||
(rfc2068:token? s)))
|
(rfc2068:token? s)))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user