[whatwg] [mimesniff] Review requested on MIME Sniffing Standard

Gordon P. Hemsley gphemsley at gmail.com
Mon Nov 12 08:57:59 PST 2012


On Mon, Nov 12, 2012 at 10:06 AM, Henri Sivonen <hsivonen at iki.fi> wrote:
> Resending feedback previously written at
> https://bugzilla.mozilla.org/show_bug.cgi?id=808593#c10 :
>
> I think the bits ‘type is equal to "font" or’ and ‘type is equal to
> "archive" or’ are highly questionable. The most popular font types are
> in the process of getting application/ types and the most popular
> archives already have application/ types.

Buzzkill. ;(

> I suspect the ‘a reasonable amount of time has elapsed, as determined
> by the user agent.’ is unnecessary. The HTML spec has the same
> provision for the <meta> prescan. Firefox didn’t implement it, a
> couple of people complained, then fixed their code, and the sky didn’t
> fall.

This line was present in a previous draft of the spec, as was the
seeming allowance to begin matching the resource header before it had
finished loading. For simplicity in the algorithm, I removed the
latter, so I left the former in as an escape hatch for those who
wanted to emulate that behavior.

But if everyone vows to just wait for 512 bytes (or EOF), then that's
fine with me.

> What are the use cases for ‘Sniffing archives specifically’?

No idea. I only included it for completeness.

The 'rules for sniffing * specifically' are intended as hooks for
other specs to tie into. If no spec requires you to implement it, then
you have no need to implement it. HTML uses 'rules for sniffing images
specifically' (and 'rules for distinguishing if a resource is text or
binary'), and I imagine it could also find uses for 'rules for
sniffing audio specifically' and 'rules for sniffing video
specifically' (and maybe even 'rules for sniffing fonts
specifically').

> It
> appears that it sniffs ODF-style files
> (http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part3.html#__RefHeading__752809_826425813
> ; EPUB, ODF, InDesign, etc.) and Open Packaging Conventions-based
> files (https://en.wikipedia.org/wiki/Open_Packaging_Conventions ;
> OOXML, XPS, etc.) files as zip archives. Is that intended and a
> desirable outcome in the light of use cases? (In general, it would be
> easier to review if the spec makes sense if the use cases and callers
> of various sniffing functions were known.)

I don't think that's intended, but I don't know. The selection of
which bytes to sniff predates me, and I don't know what the use cases
are.

> Otherwise, looks good to me.

Thanks for the review!

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



More information about the whatwg mailing list