Support #13173
openAdd MIME Type *.mjs / JavaScript module
0%
Description
Please add extension *.mjs
to MIME types being served as text/javascript
.
The lack of this MIME type currently prevents from using the online PDF-Viewer pdf.js
(from versions 4++). See
https://github.com/mozilla/pdf.js/issues/17296#issuecomment-1818335844
Maybe it would be useful to add a general way of adding custom MIME types, either by a specific method in WServer
, eg. addMimeType(std::string ext, std::string mimeType)
or a section for this in wt_config.xml
?
Thank you very much!
Stefan
Updated by Matthias Van Ceulebroeck about 2 months ago
- Tracker changed from Feature to Support
- Status changed from New to Resolved
- Assignee set to Matthias Van Ceulebroeck
- Target version set to 4.11.2
Hello Stefan,
Wt is indeed lacking a couple more recent or at least relevant MIME types. We have #10903 pending, that is going to add a couple more of them (including mjs
).
I agree that it should be easier to configure, where the wt_config.xml
seems like the best place. However, this file is already very big, and certain elements lack documentation. While it should be exposed, I'm hesitant to "pollute" this file any further.
I will bump the related ticket in priority (as we've had JS Module questions before), and consider something for configuration for the future.
As this relates to the linked ticket, I will mark this as a "Support" ticket that has been "Resolved".
Best,
Matthias
Updated by Matthias Van Ceulebroeck about 2 months ago
- Related to Feature #10903: Add more MIME types to src/http/MimeTypes.C? added
Updated by Matthias Van Ceulebroeck about 2 months ago
- Related to Improvements #13188: Allow for additional MIME types to be defined added