Skip to content

Web platform tests disagree on how to handle blob content-type validation #189

Open
@wisniewskit

Description

@wisniewskit

What is the issue with the MIME Sniffing Standard?

While trying to pass all of mimesniff/mime-types/parsing.any.html in Firefox, I've noticed that as I start passing more of the tests there by sending the content-type through our standards-compliant MIME type parser, other tests suddenly fail in FileAPI/file/File-constructor.any.html, such as:

  FAIL Valid contentType ("text/plain;charset = UTF-8") - assert_equals: expected "text/plain;charset = utf-8" but got "text/plain"

Furthermore, the current File API specs 1 2 3 don't mention passing the content type through a MIME validator, meaning that a lot of the tests in parsing.any.html are invalid, because they necessarily construct Blobs or Files (also the tests for Request/Response use blob() as well).

I'm not sure how to rectify this. The most obvious alternatives are of course to either:

  1. change the Blob constructor spec to be more strict (but I'm not sure if this is risky).
  2. change the parsing.any.js expectations for the Blob cases to expect blob-standard content type parsing.

@annevk , what do you think? I recall conversations about this in the past, but don't remember if option 1 is feasible. Would #2 be the way to go in that case, or should we defer this for now? (I'm open to just having Firefox match Chrome and Safari as closely as possible for now, if we're not ready to tackle this anytime soon).

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs testsMoving the issue forward requires someone to write tests

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions