-
Notifications
You must be signed in to change notification settings - Fork 79
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
Should mime just use the MIME sniffing algorithm? #106
Comments
https://mimesniff.spec.whatwg.org/ is called "MIME Sniffing" and contains a parse a MIME type algorithm that is relevant. But "sniffing" refers to looking at the contents of a file or the body of an HTTP response (in addition to other signals) to make a guess at the actual file format, in case the This kind of sniffing can be useful, but I don’t know if it should be in scope for this crate. |
Sorry, I don't mean sniffing the body bytes, just using the parse algorithm mentioned in that document. |
So, looking through the test cases, I noticed this as a valid MIME type:
Something I appreciate in the API in mime/master is the difference between So I'm torn. |
After some more thought, the advantages of just following what the Fetch spec wants outweighs having So, the new plan is to remove the split, only having |
The closest it is to the mimesniff algorithm, the more we can make use of it. |
What would be useful too is a way to represent just the essence of a mime type, because many specs have prose about that. |
Hi, Is there a way to expose the both parsers (rfc and mime-sniff)? Actually i'd like to make some servo tests pass, so i need to follow the mime-sniff algo. @SimonSapin already has implemented it in rust-url (but not officially exposed by the crate). Should i duplicate the code in servo or can i help here? Regards |
The target domain of the
mime
crate is webdev. Instead of following the original RFCs (as is done now), perhaps it's best to just use the sniffing algorithm that is now used by web browsers.The text was updated successfully, but these errors were encountered: