cloudhead / node-static

rfc 2616 compliant HTTP static-file server module, with built-in caching.
MIT License
2.17k stars 245 forks source link

Update to latest mime-db, to send "text/javascript" MIME type for ".js" / ".mjs" files? #239

Closed getify closed 12 months ago

getify commented 1 year ago

A long-standing issue I've faced (for literally years) is that the upstream mime-db, which node-static uses to determine a MIME type to send as a response header for each file extension (like ".js")... but that DB has been sending the old (and now deprecated/removed) "application/javascript" MIME type instead of the newer preferred "text/javascript".

An IETF/IANA change finally made that switch official earlier this year, and now mime-db has apparently updated to include that change.

It would be great if node-static could now pull in the latest mime-db, and verify that in fact "text/javascript" is sent out by default for ".js" (and ".mjs") file extensions.