-
Notifications
You must be signed in to change notification settings - Fork 47
Description
There's two places where we have a need for sniffing in the web platform as I understand it:
Navigation. Here the point is to determine whether it's HTML, plain text, media, PDF, or a download. For media there is of course some decision about what decoder to use at some point, but the most important decision here is whether it will be send to the decoder at all.
Individual endpoints. Here it's mostly about documenting what decoders accept and should reject. We don't really care whether an implementation uses a single decoder for all of media or has separate pipelines for various media formats. That's indeed the realm of other specifications that define what a byte stream results in. (And note that often there is a step before invoking this in the individual endpoints where the MIME type is checked first. E.g.,
image/svg+xml
is handled in a special manner in the image endpoint pipeline.)And there will be a third: https://github.com/annevk/orb.
The original purpose of mimesniff was the first point, but many authors have been using it for the second point.
We should discuss whether the second point is within the scope of mimesniff and, if so, how to structure the spec to avoid conflating the two (or three).