Re: Parsing headers, was: Abstract from HTTP <was> Re: Welcome to JSR 311

From: Julian Reschke <>
Date: Tue, 10 Apr 2007 15:37:23 +0200

Jerome Louvel schrieb:
> This is possible and even required by the HTTP spec:
> "Multiple message-header fields with the same field-name MAY be present in a
> message if and only if the entire field-value for that header field is
> defined as a comma-separated list [i.e., #(values)]. It MUST be possible to
> combine the multiple header fields into one "field-name: field-value" pair,
> without changing the semantics of the message, by appending each subsequent
> field-value to the first, each separated by a comma. The order in which
> header fields with the same field-name are received is therefore significant
> to the interpretation of the combined field value, and thus a proxy MUST NOT
> change the order of these field values when a message is forwarded. "
> Accept: foo/bar;ext="a,b", text/plain
> To return to your example, the fact that "a,b" is a quotes string indicates
> to the header parser that the comma should be ignored as a general header
> separator.


that's understood. The trouble here is that this means that it's
impossible to split a list-typed header into its components without
knowledge of the syntax of the individual components.

Best regards, Julian