mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 19:50:24 +02:00
better cache-control: private, no-cache parsing
* module/web/http.scm (cache-control): Parse private and no-cache better. * test-suite/tests/web-http.test ("general headers"): Update.
This commit is contained in:
parent
ac7f17e3ca
commit
25731543d4
2 changed files with 12 additions and 3 deletions
|
@ -966,7 +966,12 @@ phrase\"."
|
||||||
((max-age max-stale min-fresh s-maxage)
|
((max-age max-stale min-fresh s-maxage)
|
||||||
(cons k (parse-non-negative-integer v-str)))
|
(cons k (parse-non-negative-integer v-str)))
|
||||||
((private no-cache)
|
((private no-cache)
|
||||||
(cons k (if v-str (split-and-trim v-str) #t)))
|
(if v-str
|
||||||
|
(cons k (map (lambda (f)
|
||||||
|
(or (and=> (lookup-header-decl f) header-decl-sym)
|
||||||
|
f))
|
||||||
|
(split-and-trim v-str)))
|
||||||
|
k))
|
||||||
(else (if v-str (cons k v-str) k))))
|
(else (if v-str (cons k v-str) k))))
|
||||||
default-kv-validator
|
default-kv-validator
|
||||||
(lambda (k v port)
|
(lambda (k v port)
|
||||||
|
|
|
@ -76,9 +76,13 @@
|
||||||
|
|
||||||
(pass-if-parse cache-control "no-transform" '(no-transform))
|
(pass-if-parse cache-control "no-transform" '(no-transform))
|
||||||
(pass-if-parse cache-control "no-transform,foo" '(no-transform "foo"))
|
(pass-if-parse cache-control "no-transform,foo" '(no-transform "foo"))
|
||||||
(pass-if-parse cache-control "no-cache" '((no-cache . #t)))
|
(pass-if-parse cache-control "no-cache" '(no-cache))
|
||||||
|
(pass-if-parse cache-control "no-cache=\"Authorization, Date\""
|
||||||
|
'((no-cache . (authorization date))))
|
||||||
|
(pass-if-parse cache-control "private=\"Foo\""
|
||||||
|
'((private . ("Foo"))))
|
||||||
(pass-if-parse cache-control "no-cache,max-age=10"
|
(pass-if-parse cache-control "no-cache,max-age=10"
|
||||||
'((no-cache . #t) (max-age . 10)))
|
'(no-cache (max-age . 10)))
|
||||||
|
|
||||||
(pass-if-parse connection "close" '("close"))
|
(pass-if-parse connection "close" '("close"))
|
||||||
(pass-if-parse connection "close, foo" '("close" "foo"))
|
(pass-if-parse connection "close, foo" '("close" "foo"))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue