[whatwg] First or last Content-Type header?

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