Comments (5)
You're encountering a bug in mime
itself. You see, you're passing in application/json
and that module incorrectly thing you're looking for the file json
and then incorrectly things the file extension for that is json
. You can see it's not echoing the type if you do
$ node
> const mime = require('mime')
> mime.lookup('text/plain')
'application/octet-stream'
>
from mime-types.
This is the bug: broofa/mime#113
from mime-types.
And this module fixed the bug (which is one of the purposes of this module: incorporate bug fixes that mime
is not fixing :) ).
from mime-types.
I updated the blurb in the README to note that there are bug fixes to the .lookup
method compared to the mime
module.
from mime-types.
Thank you for clarifying, I misunderstood the use case for the lookup function initially.
from mime-types.
Related Issues (20)
- Is it possible to get is image HOT 2
- Can I contribute the features from my fork? (TypeScript, Browser support, uses "exports") HOT 2
- Way to override `mime-db` HOT 4
- application/javascript should be replaced with text/javascript HOT 6
- CRA to Vite migration, process is not defined error in 'mime-types' package.
- Wrong Mime Type for .wav file
- Drop outdated node platforms from CI test matrix HOT 3
- Use `mime-score` to resolve extension conflicts.
- Provide feedback on https://github.com/broofa/node-mime/issues/162 HOT 1
- Type inconsistencies between node-mime, MDN, and mime-db HOT 2
- Bump mime-db version up to the most recent one HOT 1
- New Version ETA HOT 12
- Remove "path" dependency from library HOT 11
- Change API to return null or undefined and not false HOT 3
- `image/svg+xml` charset HOT 1
- png with extension changed to jpg shows wrong mime type HOT 1
- Module not found: Error: Can't resolve 'path' in app/node_modules/mime-types HOT 4
- New release HOT 3
- ESM/browser support HOT 12
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-types.