(web http): header names always represented as symbols
authorAndy Wingo <wingo@pobox.com>
Sat, 8 Jan 2011 18:54:07 +0000 (10:54 -0800)
committerAndy Wingo <wingo@pobox.com>
Sat, 8 Jan 2011 18:54:07 +0000 (10:54 -0800)
commitbe1be3e597947038a497610eac3053508bf0d7f2
tree0741525d6c05ebc6efd3e74ec3f0df4b9c179296
parenta574564c24f5d08790f5a429c0f285938363a3f0
(web http): header names always represented as symbols

* module/web/http.scm (declare-header!): No need to specify `sym', as it
  can be derived from `name'. Change to take parser, validator, and
  writer as positional arguments, and multiple? as a keyword.
  (parse-header): Change to take the header as a symbol already, and
  just return the parsed value.  All headers are symbols now, including
  unknown headers.  I feel OK doing this given that the symbol GC works
  now.
  (lookup-header-decl): Only look up headers by symbol.
  (read-header): Adapt to parse-header change.

  (valid-header?, write-header): Adapt to all headers being symbols.
  (split-header-names, list-of-header-names?, write-header-list):
  Represent all header names as symbols.

  (declare-opaque-header!, declare-date-header!)
  (declare-string-list-header!, declare-header-list-header!)
  (declare-integer-header!, declare-uri-header!)
  (declare-quality-list-header!, declare-param-list-header!)
  (declare-key-value-list-header!, declare-entity-tag-list-header!):
  Change to be functions instead of syntax, and no need to specify the
  symbolic name. Update all header declarations accordingly.

* module/web/request.scm (validate-headers):
* module/web/response.scm (validate-headers): Adapt to all headers being
  symbols.

* test-suite/tests/web-http.test (pass-if-parse, pass-if-any-error)
  (pass-if-parse-error): Update for parse-header change.
  ("general headers"): Update header list examples to be all symbols.
module/web/http.scm
module/web/request.scm
module/web/response.scm
test-suite/tests/web-http.test