[whatwg] [mimesniff] More issues on the MIME Sniffing spec

Gordon P. Hemsley gphemsley at gmail.com
Thu Jun 6 07:22:05 PDT 2013


On Thu, Jun 6, 2013 at 5:42 AM, Peter Occil <poccil14 at gmail.com> wrote:
> I want to respond to the following issues in the MIME Sniffing spec:
>
> Resources
>
> I suggest the following wording for the issue box starting with "A resource
> is..."
>
>    A resource is a data item or message, such as a file or an HTTP response.
>
> I believe this covers the cases that would normally be associated with a
> MIME type.

I already have an idea about how to define "resource".

The reason it's not currently in the spec is because I recall Hixie
expressing some concern about complexity beyond "bag of bits" and I'm
waiting on feedback from him.

> Contexts
>
> I don't think the word "context" needs to be specially defined.  The start
> of section 8
> could be rewritten to remove the definition:
>
> [[
> In certain cases, it is only useful to identify resources that belong to a
> certain subset of MIME types. In these cases, it is appropriate to use a
> context-specific sniffing algorithm in place of the MIME type sniffing
> algorithm in order to determine the sniffed MIME type of a resource.
>
> This specification defines the following context-specific sniffing
> algorithms.
> ]]

On the contrary, I think it may be important to define "context", as
it is the only lens through which to see fetching and sniffing and the
like.

Currently, the HTML spec only defines "(nested) browsing context", so
I put together a wiki page that lists all the other ones that exist
implicitly:

http://wiki.whatwg.org/wiki/Contexts

I plan to rewrite the whole second half of the spec to be in terms of
contexts soon.

> Apache Bug
>
> As for the Apache bug flag, would it be useful to additionally check the
> HTTP
> headers for a Server header and check if it contains "Apache/"?  I don't
> know which
> version of Apache the bug involved was fixed in, so I can't suggest a more
> accurate
> string check.

That thought had crossed my mind, but the handling of the situation
mostly predates my editing of the spec, so I haven't given much
thought into whether the current method is the ideal one.

> MP3 Sniffing
>
> Finally, the Firefox team has recently included a patch to support sniffing
> MP3
> files better [1] and would like to document it and add it to the MIME
> Sniffing
> spec. [2]  The disadvantage, though, is that more than 512 bytes
> are required for an accurate detection.
>
> --Peter
>
> [1]: https://bugzilla.mozilla.org/show_bug.cgi?id=862088
> [2]: https://bugzilla.mozilla.org/show_bug.cgi?id=879429
>

I'm aware of this. I was told that a proposal would be made in due
course, so I'm waiting on that.

--
Gordon P. Hemsley
me at gphemsley.org
http://gphemsley.org/http://gphemsley.org/blog/



More information about the whatwg mailing list