[rest-practices] [Fwd: [rhevm-api] concatenating Link headers in response to entry-point HEAD method]

Bill Burke bburke at redhat.com
Tue May 4 21:25:42 UTC 2010


By concatenation, you mean comma delimited, right?  That's what the link 
header spec defines.

Mark McLoughlin wrote:
> Hey,
> 
> I thought this had been discussed here, but I don't think so.
> 
> Eoghan found some issues with including multiple Link: headers.
> 
> I've seen something similar - a ruby client was only giving me a single
> Link: header.
> 
> We've decided to concatenate our Link headers together on the server
> side, as ugly as that is.
> 
> Cheers,
> Mark.
> 
> -------- Forwarded Message --------
>> From: Eoghan Glynn <eglynn at redhat.com>
>> To: rhevm-api <rhevm-api at lists.fedorahosted.org>
>> Subject: [rhevm-api] concatenating Link headers in response to
>> entry-point HEAD method
>> Date: Mon, 26 Apr 2010 09:11:24 +0100
>>
>>
>> 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.
>>
>> 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]
>>
>> 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()?
>>
>> Cheers,
>> Eoghan
>>
>>
>> [1] http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2
>>
>>     
>>
>> _______________________________________________
>> rhevm-api mailing list
>> rhevm-api at lists.fedorahosted.org
>> https://fedorahosted.org/mailman/listinfo/rhevm-api
> 
> 
> _______________________________________________
> rest-practices mailing list
> rest-practices at redhat.com
> https://www.redhat.com/mailman/listinfo/rest-practices

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com




More information about the rest-practices mailing list