1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-16 16:50:21 +02:00

http: lists of header names parse better

* module/web/http.scm (list-of-strings?, write-list-of-strings): Move
  definitions up.
  (split-header-names, list-of-header-names?, write-header-list): New
  helpers.
  (declare-header-list-header): New helper.
  (cache-control): Use split-header-names for private and no-cache.
  (trailer): Use declare-header-list-header to parse known headers to
  symbols.
  (vary): Likewise, use split-header-names et al.

* test-suite/tests/web-http.test ("general headers"): Add a test.
This commit is contained in:
Andy Wingo 2010-12-16 18:12:08 +01:00
parent 25731543d4
commit adc91e41bf
2 changed files with 42 additions and 15 deletions

View file

@ -97,6 +97,7 @@
(pass-if-parse pragma "no-cache, foo" '(no-cache "foo"))
(pass-if-parse trailer "foo, bar" '("foo" "bar"))
(pass-if-parse trailer "connection, bar" '(connection "bar"))
(pass-if-parse transfer-encoding "foo, chunked" '(("foo") (chunked)))