koajs / static-cache

[MAINTAINERS WANTED] Static cache for koa
293 stars 47 forks source link

How to specify custom mime map definition? #69

Closed dickeylth closed 7 years ago

dickeylth commented 7 years ago

https://github.com/koajs/static-cache/blob/master/index.js#L200

obj.type = obj.mime = mime.lookup(pathname) || 'application/octet-stream'

The code logic here is using mime-types to check the corresponding mime type for filepath, however if I want to customize mime type for specific extname, I guess it's unavailable currently?

dead-horse commented 7 years ago

yes, but you can add a middleware to reset content-type after static-cache middleware.