W3C home > Mailing lists > Public > public-whatwg-archive@w3.org > November 2012

Re: [whatwg] [mimesniff] Treating application/octet-stream as unknown for sniffing

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Thu, 29 Nov 2012 12:57:43 -0500
Message-ID: <50B7A217.4080300@mit.edu>
To: "Gordon P. Hemsley" <gphemsley@gmail.com>
Cc: whatwg@lists.whatwg.org
On 11/29/12 12:45 PM, Gordon P. Hemsley wrote:
> The apparent contradiction occurs when, e.g., an Opus file is tagged
> as "application/octet-stream".
>
> If I understand correctly, a UA would return "" when canPlayType() is
> called against such a file

canPlayType is not called "against a file".  It's called with a single 
argument which is a string MIME type.  If you pass 
"application/octet-stream", it will return "".  Its behavior does not 
depend on any state of the element it's called on (like what it's 
actually pointing to, etc); only on the string passed in.

> but then the file would actually play
> because it is later sniffed as "application/ogg".
>
> Am I missing something?

I think you're misunderstanding what canPlayType does?

-Boris
Received on Thursday, 29 November 2012 19:14:43 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 16:24:14 UTC