On Mon, 2010-04-26 at 09:11 +0100, Eoghan Glynn wrote:
Folks,
We've noticed some funnies with the handling of multiple headers of the
same name by various REST providers, with RESTeasy concatenating the
header values into a comma separated list, and CXF JAX-RS seemingly
dropping all but the last header instance.
I also noticed Ruby's rest_client dropping all but one Link header
In the light of the following chapter & verse from the 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."[1]
Nice find
It seems like a concatenation is the canonical form and least likely
cause trouble along the way. So how about we simply squash together the
Links set in the implementations of ApiResource.head()?
Sounds good - it'd be better if RESTeasy did this itself, but no reason
not to do it ourselves in the meantime
Cheers,
Mark.