-
-
Notifications
You must be signed in to change notification settings - Fork 260
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
Add extensions for obsolete mimetypes #112
Comments
We're not willing to manually maintain a list like this. The purpose of this database is to aggregate sources though the build scripts. Is there a source somewhere we can scrape this data from? |
The IANA source have most of the information. For example, the "text/javascript" template page contains a line of "File extension(s): .js" and a line of "Intended usage: OBSOLETE". |
Ah, so it sounds like this can be just adding some additional scraping rules into the IANA scraper. |
I did a little check and it seems that many mimetypes defined by IANA also have file extensions missing, such as application/cccex (.c3ex) and text/vnd-curl (.curl). Another problem could arise is that how do we merge the file extensions if they are defined differently in IANA, Apache, and nginx sources? |
I assume just list them all unless there is another suggestion. |
I am not sure how you currently do it. I would suggest:
(Assume the priority is IANA >Apache >ngnix) |
I believe that is what the build script does already 👍 |
This issue is here for a year. Any plan on it? |
Just make a pull request updating the build script to pull the data on if types are obsolete from the IANA database, right? |
I think so. Are you going to implement it? |
Perhaps one day if I have the time and desire to. If you want to see it earlier, feel free to implement 👍 |
Sometimes we'd want to lookup a file extension from a given mimetype. For example, we want to get "js" if we are given a mimetype "text/javascript". This is currently not possible since the "extensions" key for "text/javascript" is not defined.
I'd suggest that we define an obsolete mimetype, such as "text/javascript", like this:
So that the application is able to get an extension when "text/javascript" is given. If the application wants to reversely look for the mimetype for "js", it can ignore the "text/javascript" according to its "obsolete" value.
We can optionally add a
"canonical": "application/javascript"
to indicate what this obsolete mimetype is now redirected to.The text was updated successfully, but these errors were encountered: