New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong behavior of application/wasm
mime type
#220
Comments
Just got hit by this as well. This basically breaks |
https://github.com/jfhbrook/node-ecstatic/blob/master/lib/ecstatic.js#L242-L247 potentially a bug in mime@1 ? upgrading mime is part of a bigger project. |
Yeah, I think that's the cause. Seems that the mime package removed the charset functionality entirely in v2. Ideally, if there'd be a way to detect that a mime type is indicating a binary file, appending the charset could simply be skipped, or something like that. |
I'd like to request "charset=utf-8" skipping for binary files. |
Seems like ecstatic isn't using
And here's how ecstatic is using it:
I was wondering if maybe that changed lately, but it seems |
We're using mime@1, which hasn't had an api update in Some Time. Presumably, this code would change if we upgraded to v2, which will happen Eventually if someone puts the time in. I agree with @bytex64 's assessment and I think this was just a mistake. Though, I think that at least for some mime types, defaulting to UTF-8 is appropriate? Maybe this can be thrown behind a feature switch, though. Will accept a pull request that implements this! |
FWIW, folks using http-server have found that this breaks image usage (via Fetch + createImageBitmap()) in Firefox (at least): http-party/http-server#296 (comment) I'm be submitting a PR shortly to remove the defaulting to |
The mime upgrade has been a long time coming. If you're willing to put the work into it I'd love to merge that and just bang out a major release. |
It looks like the biggest thing missing (according to #218 and some follow-up research) is the loss of the For now I'll reach out to see if the |
If you like! Though I don't think they were interested in supporting apache mime files anymore. One suggestion from that ticket was to make it so you could implement your own lookup function, which I think is actually pretty good and a solid way to punt on this. But I'll take it either way. |
The Just filed such an issue here, fwiw: jshttp/mime-db#133 |
I think #240 fixes this. |
Current webassebmly spec says
For now ecstatic adds charset in
Content-Type
for all filetypes, so mimetype for wasm files will beapplication/wasm; charset=utf-8
. Can we somehow disable this for files withapplication/wasm
mimetype (or for binary files at all?)?I'll be happy to create PR if you tell me right way to figure out exclusions.
The text was updated successfully, but these errors were encountered: