-
Notifications
You must be signed in to change notification settings - Fork 351
should Response.blob() type include parameters like charset? #540
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
Comments
For traceability, thread starts here: https://github.com/jhabdas/fetch-inject/pull/14 |
The spec talks about mime type, which blob type is related, and content type. |
I think its browser consistency. FF and Edge always include the charset parameter in the blob type if the source has it. Chrome and Safari seems to remove the charset parameter when coming from some sources, like network. They include the charset parameter when coming from other sources, like a manually created blob. It feels like we should converge to some common behavior. |
Right, and we should probably convergence on "content type" since "MIME type" doesn't include sufficient information in all cases. |
I'm dropping in some links here which I believe most developers in the know use when referencing APIs for development in 2017, and the descriptions of those items: http://devdocs.io/dom/blob/type
http://devdocs.io/dom/response/headers
As things are, common knowledge suggests What would be the value in converging on something which is not common knowledge and that which can already be determined using other available mechanisms? |
If you consume a |
This is greek to me, but it seems it may bear relevance to this discussion: Lines 423 to 430 in a38ae96
|
That's about which headers can emitted across origins without CORS preflight. Unrelated. |
The http://stackoverflow.com/a/23152871/712334
Please let me know if I can help issue browser bugs to help with behavioral normalization when it makes sense to help me level-up my understanding. Cheers. |
@JHabdas ah yeah, There's also w3c/FileAPI#43 that needs to be sorted in some way I suppose. |
Chrome bug submitted and linked: https://bugs.chromium.org/p/chromium/issues/detail?id=724433 |
This relates to whatwg/mimesniff#30. |
FWIW, I basically concluded here that yes, it should include parameters. web-platform-tests/wpt#7764 tests this and implementation bugs have been filed as well, so I think this can be closed? |
Writing this issue based on this gecko bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=1362824
To summarize, if you visit this test in different browsers you will get different blob types:
https://bl.ocks.org/jhabdas/87f8bc3573cf91b4c35e0c799addd762
You get:
text/css
text/css
text/css
text/css; charset=utf-8
text/css; charset=utf-8
Alternatively, if you run this code in the console in various browsers you get a different set of types:
You get:
As you can see, browsers are inconsistent in whether to include the charset param in the
Blob.type
content-type value. Firefox always includes it. Safari never includes it. Chrome sometimes includes it.What do people think these different cases should do?
Sorry if this should go on a different spec, but behavior seems somewhat dependent on source, so thought fetch might be a reasonable place to start.
The text was updated successfully, but these errors were encountered: