jshttp / mime-db

Media Type Database
MIT License
1.11k stars 256 forks source link

Re-raising the now updated JS mime-type issue (from #194) #266

Closed getify closed 1 year ago

getify commented 2 years ago

( I don't know why the conversation in #194 was locked (seems a silly overreaction), but whatever. I'm reopening discussion now. )

The proposed IETF RFC we had been discussing (RFC 9239) over in #194 has now officially been published. There shouldn't be any other question/debate about it now: the only official registered MIME type for JS is "text/javascript", not "application/javascript".

As such, it would be very helpful for this registry DB to update accordingly, as downstream utilities like broofa/mime and node-static are reliant on this database for automatically determining which MIME type to send for JS files.

dougwilson commented 2 years ago

Hello @getify sorry about that! At the time, the issue was in contention, the spec was still a draft, and more was being done. Now it is finalized, and there is an open PR. Unfortunately NGINX and Apache have still not yet updated, and those are sources for this database as well, so the database ends up with both mime types with .js as the file extension. We are working to get those upstreams updated and then get everything released 👍

dougwilson commented 2 years ago

Since type types are now marked as "obsolete" in IANA, I'm thinking that changing our pull logic to exclude types marked as obsolete, so that may help downstream libs like mime decide which type to use for .js extension -- the apache/nginx one or the iana one. So far, it's been a week and really have not heard anything back from those projects, so we may release a new db with both in there and the downstream consumers will need to decide which to use.

ZebraFlesh commented 1 year ago

Has there been any movement on this issue? I would love to be able to serve JS files with the correct mime type instead of application/javascript.

dougwilson commented 1 year ago

Hi @ZebraFlesh sorry about that, I wrote the logic above already, but ran in to other consequences. I got them mostly addressed, but currently our build process is broken due to an upstream dependency, so I have not made further movement yet. The dependency has reaolved the issue, but not yet issued a release with it.

As for serving files, this module is just a json file and does not force you to use any specific mim type in your web server. Your web server may use this db for the defaults but you should consult your web server's documentation for how to provide overrides so you are not blocked by us.

ZebraFlesh commented 1 year ago

Thanks, I appreciate the response. I'm consuming mime-db as a transitive dependency though, so this is just the first step in resolving my issue.

Is there anything I can do to help move this forward?

dougwilson commented 1 year ago

We just need a new release of the nvm program so our build system on CI is working again, so we can make releases. I already pinged the nvm project and they said they are working on a release. If you are interested, that is probably where you could lend a hand, if they are willing.

dougwilson commented 1 year ago

Closing this issue as the changes where already merged in to master, but the issue wasn't referenced on accident so the issue was not closed automatically.