W3C home > Mailing lists > Public > whatwg@whatwg.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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 30 January 2013 18:48:11 GMT