Re: [Bug #131388] joining Location header results into wrong URLs

Bjoern Hoehrmann (derhoermi@gmx.net)
Thu, 08 Feb 2001 13:07:21 +0100


* noreply@sourceforge.net wrote:
>Some servers return two Location: headers
>(e.g.
>http://service.bfast.com/bfast/click?bfmid=20911217&siteid=37451739&bfpage=hplink
>after 2nd redirect - it's where code boiled out). push_header() will join
>URLs with ', ', and this is kinda wrong =)

Quoting from RFC 2616 section 4.2:

|    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.

It's an invalid response; LWPs treatment is 100% conforming, with
respect to the fact, that LWP does not validate the HTTP messages.
Better go and repair those servers.
-- 
Björn Höhrmann ^ mailto:bjoern@hoehrmann.de ^ http://www.bjoernsworld.de
am Badedeich 7 ° Telefon: +49(0)4667/981028 ° http://bjoern.hoehrmann.de
25899 Dagebüll # PGP Pub. KeyID: 0xA4357E78 # http://learn.to/quote [!]e
                        ~~ will code for food. ~~