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

Gordon P. Hemsley gphemsley at gmail.com
Thu Nov 29 09:45:35 PST 2012


On Thu, Nov 29, 2012 at 3:02 AM, Boris Zbarsky <bzbarsky at mit.edu> wrote:
> On 11/29/12 2:53 AM, Gordon P. Hemsley wrote:
>>
>> At one point it says, "The MIME type "application/octet-stream" with
>> no parameters is never a type that the user agent knows it cannot
>> render. User agents must treat that type as equivalent to the lack of
>> any explicit Content-Type metadata when it is used to label a
>> potential media resource."
>>
>> But later it says, "The canPlayType(type) method must return the empty
>> string if type is a type that the user agent knows it cannot render or
>> is the type "application/octet-stream";"
>
>
> What's the contradiction?  We have set S = { types the user agent knows it
> cannot render }.  We have set T = S union { application/octet-stream }
>
> What the above statements tell us so far is:
>
> 1)  T != S
> 2)  canPlayType(type) must return empty string for all types in T.
>
> But later on in the resource selection algorithm there are certain actions
> taken for elements of S only.
>
>
>> This seems to me to be unclear as to when sniffing of the audio/video
>> resource occurs, and what it is used for.
>
>
> It's used for actually showing the video even if it's sent as
> application/octet-stream.

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—but then the file would actually play
because it is later sniffed as "application/ogg".

Am I missing something?

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



More information about the whatwg mailing list