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

Clarify sniffing of empty resources #101

Open
annevk opened this issue Mar 30, 2019 · 0 comments
Open

Clarify sniffing of empty resources #101

annevk opened this issue Mar 30, 2019 · 0 comments

Comments

@annevk
Copy link
Member

annevk commented Mar 30, 2019

From https://www.w3.org/Bugs/Public/show_bug.cgi?id=25190 by Robin Berjon:

It is unclear to me what empty payloads with no labelling content-type are supposed to be sniffed as.

Following the algorithm, I eventually reach:

"""
9. If the resource header contains no binary data bytes, the sniffed MIME type is "text/plain". > Abort these steps.
10. The sniffed MIME type is "application/octet-stream".
"""

It's not entirely clear that if the resource header contains nothing then it can be said to contain no binary data bytes. (Or rather, at the very least the case seems to be treated differently by implementations.)

In testing of such a resource (loaded into an iframe), Gecko prompts for download whereas Blink, WebKit, and Trident all report the document.contentType as undefined.

It would be worth deciding what empty unlabelled payloads should sniff as.

Seems to me this should be text/plain, but would be good to verify with tests.

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

1 participant