W3C home > Mailing lists > Public > whatwg@whatwg.org > May 2009

[whatwg] First or last Content-Type header?

From: Geoffrey Sneddon <foolistbar@googlemail.com>
Date: Sun, 31 May 2009 18:44:43 +0100
Message-ID: <A9BCECEA-EA03-491F-B673-AE7D0ACB6F6E@googlemail.com>

On 31 May 2009, at 12:55, Geoffrey Sneddon wrote:

> IE use the first header in all cases where it doesn't expect the  
> header to appear more than once (i.e., a header like "X-Foobar"  
> appearing twice returns the value of the first one).

I don't think this is quite true, actually. It doesn't always use the  
first header, I don't think (from memory). Try:

Content-Type: jkfjkdsfjdsf
Content-Type: text/xml
Content-Type: text/plain

I think it'll use text/xml as the first valid value (and in the case  
of other browsers using the last header gives compat. with the  
majority of the content that relies upon this behaviour).

It's probably simplest just using the last header, actually, then.

I should probably try playing around with HTTP parsing again some more?


--
Geoffrey Sneddon
<http://gsnedders.com/>
Received on Sunday, 31 May 2009 10:44:43 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:12 UTC