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 12:55:21 +0100
Message-ID: <26628B55-678F-4ED8-BF72-B6D78C332641@googlemail.com>

On 30 May 2009, at 23:20, Adam Barth wrote:

> In editing the content sniffing Internet Draft today, I noticed the
> draft uses the *first* Content-Type header.  Internet Explorer uses
> the first Content-Type header, but Firefox and Google Chrome use the
> last Content-Type header.  (I don't recall off-hand which Safari or
> Opera use.)  Because the sniffing algorithm is more similar to the
> algorithms used by Firefox and Google Chrome, I've changed this aspect
> to match them as well.

Firefox, Safari and Opera use the last header in all cases where there  
is a header that is only expected to appear once (i.e., doesn't take a  
#rule as a value), and have a list of all headers that they expect to  
appear only once. 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 know about Chrome, because that only appeared after I last did  
any work on HTTP parsing (but it normally follows Firefox from the  
small amount of experimentation I've done with it since). I, on the  
whole, would be tempted to take the first header, and use a list of  
headers that you expect to only appear once (i.e., a mix of behaviours).


--
Geoffrey Sneddon
<http://gsnedders.com/>
Received on Sunday, 31 May 2009 04:55:21 UTC

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