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

blob() method: define behavior when get the MIME type return null #1802

Open
F3n67u opened this issue Jan 17, 2025 · 1 comment
Open

blob() method: define behavior when get the MIME type return null #1802

F3n67u opened this issue Jan 17, 2025 · 1 comment

Comments

@F3n67u
Copy link

F3n67u commented Jan 17, 2025

What is the issue with the Fetch Standard?

In the blob() method:

The blob() method steps are to return the result of running consume body with this and the following step given a byte sequence bytes: return a Blob whose contents are bytes and whose type attribute is the result of get the MIME type with this.

If get the MIME type return a null value when it failed to extracting a MIME type from headers:

To get the MIME type, given a Request or Response object requestOrResponse:
4. Let mimeType be the result of extracting a MIME type from headers.
5. If mimeType is failure, then return null.
6. Return mimeType.

I think In blob() method we need to either set type to an empty string or throw a TypeError like formData() does.

@annevk
Copy link
Member

annevk commented Jan 17, 2025

This is similar to #1693 (which links w3c/FileAPI#43). I consider this a bug in the File API for not defining the internal slot of the type getter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants