W3C home > Mailing lists > Public > public-html@w3.org > July 2010

RE: video/@src vs application/octet-stream

From: Leonard Rosenthol <lrosenth@adobe.com>
Date: Tue, 20 Jul 2010 05:14:18 -0700
To: "'Henri Sivonen'" <hsivonen@iki.fi>, "julian.reschke@gmx.de" <julian.reschke@gmx.de>
CC: Boris Zbarsky <bzbarsky@MIT.EDU>, "public-html@w3.org" <public-html@w3.org>
Message-ID: <D23D6B9E57D654429A9AB6918CACEAA97D22B40EB9@NAMBX02.corp.adobe.com>
> In general, binary formats have magic numbers that are always at least an epsilon more reliable than MIME types
>
The problem in today's world with this simplistic solution is the use of ZIP as packaging system.   There are NUMEROUS formats (many of which are international standards) in existence today that use ZIP, which means that they will also "sniff" as the same magic number.  As such, you can't rely on sniffing in this case.

Also consider other packaging systems, such as the MP4 "package" which is used for various video formats - how would a UA know one it supports only via sniffing?  It can't!

HTML and XML, as already noted, are also problematic.

Magic numbers are an archaic solution that doesn't work in a standards-based world...

Leonard

-----Original Message-----
From: public-html-request@w3.org [mailto:public-html-request@w3.org] On Behalf Of Henri Sivonen
Sent: Tuesday, July 20, 2010 6:07 AM
To: julian.reschke@gmx.de
Cc: Boris Zbarsky; public-html@w3.org
Subject: Re: video/@src vs application/octet-stream

On Jul 19, 2010, at 20:42, Julian Reschke wrote:

> On 19.07.2010 19:34, Boris Zbarsky wrote:
>> ...
>> Unfortunately, experience shows this to not be the case. A large
>> fraction of "people" seem to upload their content to their web server,
>> _maybe_ test it in the one browser they use, and move on.
> > ...
> 
> So there's a foreseeable race-to-the-bottom here. Please, this time, do not blame the server implementers.

Well, I'd blame whoever's idea it was to use HTTP-level type labeling (specifically MIME) instead of relying on in-band magic numbers for Web content.

In general, binary formats have magic numbers that are always at least an epsilon more reliable than MIME types, because there's always more server misconfiguration than there are accidental magic number collisions. (I'm well aware that HTML and XML don't have reliable magic numbers, but if MIME didn't exist, it would have been trivial to specify these formats to have mandatory magics--e.g. <?xml for XML which is not unfortunately optional.)

While historical blame placement is useful for learning purposes, it doesn't necessarily help with solving problems already created. Thus, more pragmatically, I'd put the blame on Apache being easier to configure to send application/octet-stream as the fallback type than to configure to send no type as the fallback. (I don't know if it is even *possible* to make Apache omit the Content-Type header, but I do know how to make it send application/octet-stream.)

Looking at how much of a FAQ it is[1] that <video> with Ogg doesn't work in Firefox when it works in Chrome, I think it would make sense to sniff even text/plain for magic number *in the <video> context*.

[1] See Stack Overflow and #whatwg.
-- 
Henri Sivonen
hsivonen@iki.fi
http://hsivonen.iki.fi/
Received on Tuesday, 20 July 2010 12:14:55 UTC

This archive was generated by hypermail 2.3.1 : Monday, 29 September 2014 09:39:18 UTC