-
Notifications
You must be signed in to change notification settings - Fork 324
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
Clarify priority between blob.type and Content-Type in headers for request/response.blob() #1630
Comments
I think the main thing we want to do here is to change "this's MIME type" to be more obviously an algorithm invocation. I think that would address any potential confusion. But this would be an editorial change as in principle this already makes the relevant requirements. |
I'd like to try working on the clarification. 🙋 I was wondering if https://fetch.spec.whatwg.org/#concept-body-mime-type is the right place to add the algorithm invocation 🤔 However, Thus, maybe I should update https://fetch.spec.whatwg.org/#ref-for-concept-body-mime-type%E2%91%A2 and https://fetch.spec.whatwg.org/#ref-for-concept-body-mime-type%E2%91%A3 to run the algorithm instead? |
That's great. I think there are two approaches here:
The standalone algorithm makes the mixin less generic, but that's not necessarily a bad thing I think. And it's probably the most clear. |
Thank you! Sounds good to me! I will try with this approach. |
Currently, the spec of
blob()
sayshowever, it doesn't mention when the body is a Blob with type, browsers should respect the blob's type or the Content-Type in headers.
there's a test in Chromium and WebKit.
Chromium and WebKit are respecting blob's type so they could pass the test now. For Gecko, it fails to run the test because it would respect the headers' content-type.
With confirming with @annevk in WebKit/WebKit#12376 (comment), it seems the
blob()
should always respect the header's content-type as "this’s MIME type" wins. So, I wonder maybe we would need some notes (or algorithms in theblob()
) to clarify more about blob's type when it exists in the spec?Finally, if we should respect headers' Content-Type, I will fix the test to
(As this test exists in Chromium and WebKit separately, I will try to make a WPT PR and help to remove the related one in Chromium and WebKit 🙏)
The text was updated successfully, but these errors were encountered: