-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
Closed
expressjs/expressjs.com
#1783Description
Description
Express 4.x used to export the mime transitive dependency as express.static.mime:
[email protected]exportedserve-static[email protected]exportedsend.mime[email protected]exportedmime
Express 5.x no longer provides this export, but its documentation still references it:
The newer version [email protected] no longer exports mime, so I'm not sure if this would be considered a documentation issue with Express 5.x, or a bug (which would require changes to serve-static and send). Would you please confirm?
Expectations
If this is considered a documentation issue, here is a proposed revision to the documentation of res.type(type) which would remedy the inconsistency:
If `type` contains the “/” character, then it sets the `Content-Type` to the
exact value of `type`, otherwise it is assumed to be a file extension and the
MIME type is looked up
-in a mapping using the `express.static.mime.lookup()` method.
+using the `lookup` method of the `mime-types` package.Metadata
Metadata
Assignees
Labels
No labels
