W3C home > Mailing lists > Public > whatwg@whatwg.org > October 2011

[whatwg] MIME Sniffing spec - http://mimesniff.spec.whatwg.org/

From: Daniel Glazman <daniel.glazman@disruptive-innovations.com>
Date: Sat, 22 Oct 2011 17:02:45 +0200
Message-ID: <4EA2DB15.8050603@disruptive-innovations.com>
Le 22/10/11 16:53, Boris Zbarsky a ?crit :

> Normally, when a browser receives a header of the form "text/plain ...."
> where ... is anything, it should treat the page as text-plain.
>
> However, there is a known bug in old Apache installations where Apache
> defaulted to sending a type of "text/plain" or "text/plain;
> charset=iso-8859-1" or "text/plain; charset=ISO-8859-1" or "text/plain;
> charset=UTF8" (depending on the installation) any time it didn't know
> what type of data the file was.
>
> Therefore, it is fairly common for random binary files to be served with
> those 4 exact header values. Thus, if those _exact_ strings are
> encountered the UA needs to sniff to make sure it's not actually binary.

The absence in the document of your prose just above makes it
impossible to understand, and gives the reader the impression the
proposal violates both the MIME and HTTP spec. I strongly suggest
some prose explaining why these strings, why like that, why no other
ones, based on what you just wrote above. Informative note if you want.

> You read it wrong. If the whitespace doesn't match the exact values in
> the table, the UA will just treat the page as text/plain. It's only when
> the header value is exactly one of the 4 in the table that the UA will
> go into http://mimesniff.spec.whatwg.org/#text-or-binary

Ok. Thanks for the clarification.

</Daniel>
Received on Saturday, 22 October 2011 08:02:45 UTC

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