Comments (10)
exactly "because why not" is how I see it :D
from mime-types.
We should probably let the user define the implied charset. (with fallback to UTF-8)
As for setting it, /text|json|javascript/
could work as a start.
Though it omits a lot. Specifically xml types. But we cannot guarantee that a type that has "xml" in it will have a sane charset.
from mime-types.
what do you mean? users should only be using .lookup()
if a charset isn't defined. i.e. look at contentType()
from mime-types.
oh yeah we should include javascript as well... because why not
from mime-types.
@jonathanong I mean users should be able to set the global charset for this module. (defaulting to UTF-8)
from mime-types.
meh when would anyone use taht though?
from mime-types.
We should probably let the user define the implied charset.
It's probably dubious, since they'd really need to be using Buffer
s everywhere and iconv so their generated responses are actually in the correct byte format. (i.e. they probably aren't and as such are sending UTF-8 bytes).
from mime-types.
Oh, eh. Whatever. Not using UTF-8 is pretty much nonsense anyways.
from mime-types.
Anyways; the issue landed in 48855cd
I'll think about /text|json|javascript/
.
from mime-types.
yeah, i dunno about js. i think we should wait until people open up charset issues before adding additional special cases.
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.
- Broken tests for Node@8 and Node@9
- [Resolve Method] extname is not function, at lookup function (vite) HOT 1
- lookup("map") returns "application/json" instead of false HOT 4
- 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.