mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-22 03:30:22 +02:00
more symbols in (web http)
* module/web/http.scm (declare-symbol-list-header!): New helper. ("Connection"): Redefine as a header list. ("Allow", "Content-Encoding", "Accept-Ranges"): Redefine as symbol lists. * test-suite/tests/web-http.test: * test-suite/tests/web-response.test: Adapt tests.
This commit is contained in:
parent
0acc595b94
commit
94f16a5b8f
3 changed files with 22 additions and 12 deletions
|
@ -83,8 +83,8 @@
|
|||
(pass-if-parse cache-control "no-cache,max-age=10"
|
||||
'(no-cache (max-age . 10)))
|
||||
|
||||
(pass-if-parse connection "close" '("close"))
|
||||
(pass-if-parse connection "close, foo" '("close" "foo"))
|
||||
(pass-if-parse connection "close" '(close))
|
||||
(pass-if-parse connection "Content-Encoding" '(content-encoding))
|
||||
|
||||
(pass-if-parse date "Tue, 15 Nov 1994 08:12:31 GMT"
|
||||
(string->date "Tue, 15 Nov 1994 08:12:31 +0000"
|
||||
|
@ -114,8 +114,8 @@
|
|||
"~a, ~d ~b ~Y ~H:~M:~S ~z")))))
|
||||
|
||||
(with-test-prefix "entity headers"
|
||||
(pass-if-parse allow "foo, bar" '("foo" "bar"))
|
||||
(pass-if-parse content-encoding "qux, baz" '("qux" "baz"))
|
||||
(pass-if-parse allow "foo, bar" '(foo bar))
|
||||
(pass-if-parse content-encoding "qux, baz" '(qux baz))
|
||||
(pass-if-parse content-language "qux, baz" '("qux" "baz"))
|
||||
(pass-if-parse content-length "100" 100)
|
||||
(pass-if-parse content-length "0" 0)
|
||||
|
@ -187,7 +187,7 @@
|
|||
;; Response headers
|
||||
;;
|
||||
(with-test-prefix "response headers"
|
||||
(pass-if-parse accept-ranges "foo,bar" '("foo" "bar"))
|
||||
(pass-if-parse accept-ranges "foo,bar" '(foo bar))
|
||||
(pass-if-parse age "30" 30)
|
||||
(pass-if-parse etag "\"foo\"" '("foo" . #t))
|
||||
(pass-if-parse etag "W/\"foo\"" '("foo" . #f))
|
||||
|
|
|
@ -72,12 +72,12 @@ abcdefghijklmnopqrstuvwxyz0123456789")
|
|||
`((date . ,(string->date "Wed, 03 Nov 2010 22:27:07 +0000"
|
||||
"~a, ~d ~b ~Y ~H:~M:~S ~z"))
|
||||
(server . "Apache/2.0.55")
|
||||
(accept-ranges . ("bytes"))
|
||||
(accept-ranges . (bytes))
|
||||
(cache-control . ((max-age . 543234)))
|
||||
(expires . ,(string->date "Thu, 28 Oct 2010 15:33:13 GMT +0000"
|
||||
"~a, ~d ~b ~Y ~H:~M:~S ~z"))
|
||||
(vary . (accept-encoding))
|
||||
(content-encoding . ("gzip"))
|
||||
(content-encoding . (gzip))
|
||||
(content-length . 36)
|
||||
(content-type . (text/html (charset . "utf-8"))))))
|
||||
|
||||
|
@ -96,4 +96,4 @@ abcdefghijklmnopqrstuvwxyz0123456789")
|
|||
(responses-equal? r body r* body*))))
|
||||
|
||||
(pass-if "by accessor"
|
||||
(equal? (response-content-encoding r) '("gzip")))))
|
||||
(equal? (response-content-encoding r) '(gzip)))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue