Comments (6)
Whatever the specification says the extension is for that mime type, we will add. There is no specific rule unless the IANA has some kind of restrictions. I hope that helps.
from mime-db.
Thanks
from mime-db.
Basically we don't have any specific rules, as we don't make them :) we simply aggregate the data from the three sources listed at the top of the readme.
from mime-db.
@jdesrosiers
While I didn't find much with a quick skim of rfc's at IETF... did find rfc2045, rfc2046, rfc2047, rfc2048, and rfc4288 (naming requirements). Having the right industry buzz, canonical lexical grammar, names is usually a key for finding information. More skimming/reading is up to you. 😸
If I were to take an educated guess it would probably be US-ASCII 7-bit and extensions to those standards with encoding using special sequences of ASCII characters that may not normally be allowed. So the period does fall within 0-127 decimal but also could be restrictive somewhere else in some other use case. Interoperability is usually what is aimed for between platforms as well as recognition.
Final resort is to try registering it and they'll tell you if it's okay or not.
from mime-db.
Thanks, I did some similar reading before asking the question and came up with nothing as well. I was hoping to get this added to the custom-types.json
list. My understanding is that that's the place types can be defined that aren't part of the three sources you pull from. YAML, for example, isn't on any of those lists. Do I understand correctly that JSON Schema could be added in this way as well? In those cases, I figured you might have some rules that you follow about what you accept that isn't registered by some official standards body, which is why I asked here.
Despite application/schema+json
being in use for over a decade, I don't think it's likely to be registered with IANA any time soon because we're not affiliated with any standards body, which seems to be a requirement. The schema.json
extension has never been in the specification, but it's emerged as a fairly ubiquitous practice. I expect the first step is to get that added to our spec before it could be accepted here.
from mime-db.
As far as the custom-types, in the ideal world we wouldn't need it, but I acknowledge that there are various things that should be included in the database that are not a part of our sources. Really, as I do not desire to be a registry or debate assignments, the only "rule" is that there should be a primary source that links the file extension to the media type. The best source is some kind of specification. I found https://json-schema.org/draft/2020-12/json-schema-core.html#rfc.section.14.1 which I would gather is the spec for it; no file extension is currently listed there, though.
As far as allowed characters, since this is not a registry, and the extension are just strings, it could in theory contain any chars. Now, if those char make sense to consumer of this module, I don't know, haha. Or file systems, etc. I do know that many folks use the extensions in combination with https://nodejs.org/dist/latest-v16.x/docs/api/path.html#path_path_extname_path so I would guess that given a file name foo.schema.json
most things will be unable yo figure out the "correct" media type from the name.
from mime-db.
Related Issues (20)
- '.zip' file has a 'application/x-zip-compressed' in Windows. HOT 2
- .asc extension maps to application/pgp-signature instead of application/pgp-keys HOT 1
- TypeScript file extensions map to incorrect file types HOT 1
- Re-raising the now updated JS mime-type issue (from #194) HOT 7
- Add `.json` extension for `application/jf2feed+json` HOT 2
- `.mov` vs `.qt` HOT 9
- Add .yamlld extension HOT 1
- YAML is application/yaml HOT 3
- Add image/jpeg for .jfif file extension
- ts extension incorrectly mapped to video/mp2t ? HOT 4
- Update existing dcm format HOT 1
- Minify `db.json` file HOT 5
- Missing extensions list for model/step HOT 2
- YAML missing some types HOT 5
- text/calender
- Broken tests for Node@8 and Node@9
- Add `application/x-python-code` and `text/x-python` types
- Add mime types for `mhtml` files
- Missing extensions from vnd.comicbook+zip and vnd.comicbook-rar registered with IANA HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mime-db.