Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove parsable mime type requirement? #13

Closed
inexorabletash opened this issue Jul 16, 2015 · 2 comments
Closed

Remove parsable mime type requirement? #13

inexorabletash opened this issue Jul 16, 2015 · 2 comments

Comments

@inexorabletash
Copy link
Member

In the definition for the type attribute, the spec has:

The ASCII-encoded string in lower case representing the media type of the Blob. On getting, user agents must return the type of a Blob as an ASCII-encoded string in lower case, such that when it is converted to a byte sequence, it is a parsable MIME type [MIMESNIFF], or the empty string -- 0 bytes -- if the type cannot be determined.

There's a fair bit weird about that paragraph (e.g. 'ASCII-encoded' when the entry points which set the type already reject non-ASCII input, referring to the length of the string in bytes...). But neither Chrome nor Firefox appear to do the filtering of non-parsable MIME types:

new Blob(['yo'], {type: "te?xt/plain"}).type; // "te?xt/plain"

Even if we decide to keep the spec and file/fix implementation bugs, can we rejigger the spec so that the entry points that set type (constructors, slice()) do all of the filtering work, rather than spreading it across two parts of the spec? (Unless there's subtlety I'm missing...)

cc: @annevk @Ms2ger

@annevk
Copy link
Member

annevk commented Jul 17, 2015

I agree that this logic should be in the constructor. My hope of enforcing it there was that you could then use it reliably for logic elsewhere. E.g. we want to use this value and put it in Content-Type for various networking features.

@annevk
Copy link
Member

annevk commented Jan 9, 2020

See #43 (comment) for what we should do here.

@annevk annevk closed this as completed Jan 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants