-
Notifications
You must be signed in to change notification settings - Fork 41
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
Create process for adding MIME-types to mapping. #2028
Comments
This looks reasonably canonical: https://www.iana.org/assignments/media-types/media-types.xhtml
Here's another mime handler library that has a documented change process (what they will / won't do): https://docs.pantheon.io/mime-types; having a clear process ourselves makes sense.
I'm not sure we need the sophistication of zones here. Introducing a We could do that in a 2.1.0 release (we're currently at 2.0.0) and deprecate the older API ( FYI, 325 packages depend on package:mime. |
One issue is that the IANA list is icky mine types, not a napping to file extensions. I'm not sure there is a canonical mapping. Guessing a media type from a file extension is just a guess. It would be better to actually investigate the file contents. Also a job for a dedicated tool, not a small Dart library. We can choose some existing comprehensive extension list, I think the Apache web server has one (... and there it was). Or we could get out of the mapping-extensions-to-media-types game entirely. It does seem like something people want to do, though. |
👍 That sounds great. I did create a local branch to download and create a new mapping w/ the IANA list, but like you said above there were too many mime types. |
Yet aother option is to be a vetted subset of another large list. That avoids including everything up front, but also makes it easier to say yes or no to requests. |
If we take the link above: https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types and generate a new mapping from that, we see:
Which is a relatively small number of diffs for changing our source of record for the mime types, and would move us to just pulling from some canonical list. I'm assuming the android or debian mappings would be similar in terms of diffs from our current state. |
This package has a big map of mappings from extensions to mime-types, and reverse.
There is no policy for updating this mapping, which leads to numerours requests for extensions to be added
(probably around half of: https://github.com/dart-lang/tools/issues?q=is%3Aissue%20state%3Aopen%20label%3Apackage%3Amime).
This package should do one of three things:
See #2027 for a request to simly make the mapping mutable. I would not go that way.
(For the third option, I'd probably make some kind of a
MimeRegistry
class that you can configure, and install as the default lookup for code that it runs in a zone. There are many ways to make it configurable, and I don't mind if it's mutable, as long as it's whoever creates it that ops in to that.)@devoncarew
The text was updated successfully, but these errors were encountered: