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 unknown/unknown and application/unknown #91

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

annevk
Copy link
Member

@annevk annevk commented Nov 13, 2018

Firefox has had no need for these. It seems less weird behavior is better.

See #30 for context.


Preview | Diff

Firefox has had no need for these. It seems less weird behavior is better.

See #30 for context.
@annevk
Copy link
Member Author

annevk commented Nov 13, 2018

(Note that there is much more cleanup possible here now that "extract a MIME type" is almost a thing, but it seems worthwhile doing that separately from this decision.)

cc @MattMenke2

Copy link
Member

@domenic domenic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Editorially LGTM. It would be good to check with other implementers, maybe the CORB folks?

@MattMenke2
Copy link

While I own the MIME sniffer, what the renderer actually does with the information is largely a black box to me. So I'm fine with removing them, but have no clue about the potential fallout.

Base automatically changed from master to main January 15, 2021 07:47
@GPHemsley
Copy link
Member

(No separate issue, so commenting here.)

Chromium treats "", "unknown/unknown", "application/unknown", and "*/*" as unknown MIME types:
https://chromium.googlesource.com/chromium/src.git/+/refs/heads/main/net/base/mime_sniffer.cc

Firefox defines UNKNOWN_CONTENT_TYPE as "application/x-unknown-content-type" and APPLICATION_GUESS_FROM_EXT as "application/x-vnd.mozilla.guess-from-ext":
https://hg.mozilla.org/mozilla-central/file/tip/netwerk/mime/nsMimeTypes.h

But also treats "application/octet-stream", "binary/octet-stream", and "application/unknown" as generic content types:
https://hg.mozilla.org/mozilla-central/file/tip/browser/components/downloads/DownloadsCommon.jsm

@GPHemsley
Copy link
Member

With a payload of <!DOCTYPE HTML :

Scenario Firefox Chrome
unknown/unknown without nosniff Download text/html
unknown/unknown with nosniff Download Download
application/unknown without nosniff Download text/html
application/unknown with nosniff Download Download
*/* without nosniff text/html text/html
*/* with nosniff text/plain text/plain

@GPHemsley
Copy link
Member

Support for application/unknown and unknown/unknown were reported to be exclusive to Chrome as of May 2009. (Internet Explorer 7, Firefox 3, and Safari 3.1 did not support them.)

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

Successfully merging this pull request may close these issues.

4 participants