Changeset 12106 in project


Ignore:
Timestamp:
10/02/08 21:53:56 (12 years ago)
Author:
sjamaan
Message:

Describe update/replace-header procedures

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/intarweb

    r12103 r12106  
    417417</table>
    418418
     419Any unrecognised headers are assumed to be multi-headers, and the
     420entire header lines are put unparsed into a list, one entry per line.
     421
     422==== Header-parsers
     423
    419424The parsers used to read and write header values can be customized
    420425with the following parameters:
     
    423428<parameter>(header-unparsers [ALIST])</parameter>
    424429
     430These parsers are indexed with as key the header name (a symbol) and
     431the value being a procedure which accepts three values: the name of
     432the header (symbol), the contents of the header (a string, without the
     433leading header name and colon) and the preceding headers. It should
     434merge the new header with the preceding headers and return the
     435resulting headers.
     436
     437Header parsers are supposed to call these procedures to add headers:
     438
     439<procedure>(replace-header-contents NAME CONTENTS HEADERS) => HEADERS</procedure>
     440<procedure>(replace-header-contents! NAME CONTENTS HEADERS) => HEADERS</procedure>
     441<procedure>(update-header-contents NAME CONTENTS HEADERS) => HEADERS</procedure>
     442<procedure>(update-header-contents! NAME CONTENTS HEADERS) => HEADERS</procedure>
     443
     444The {{replace}} procedures replace any existing contents of the named
     445header with new ones, the {{update}} procedures add these contents to
     446the existing header. The procedures with a name ending in bang are
     447linear update variants of the ones without the bang. The header
     448contents have to be normalized to be a 2-element vector, with the
     449first element being the actual value and the second element being an
     450alist (possibly empty) of parameters/attributes for that value.
     451
     452The update procedures append the value to the existing header if it is
     453a multi-header, and act as a simple replace in the case of a
     454single-header.
     455
    425456Whether a header is allowed once or multiple times in a request or
    426457response is determined by this parameter:
    427458
    428459<parameter>(single-headers [LIST])</parameter>
     460
     461The value is a list of symbols that define header-names which are
     462allowed to occur only once in a request/response.
    429463
    430464=== Changelog
Note: See TracChangeset for help on using the changeset viewer.