Skip to content
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

nginx: add "application/javascript" MIME type for mjs files #299

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

max-moser
Copy link
Contributor

@max-moser max-moser commented Dec 11, 2024

Otherwise, nginx may fall back to using "application/octet-stream" which browsers may not like.
For instance, pdfjs-dist v4 uses mjs files, which is used by the new PDF previewer in Invenio-Previewer.
The files are transferred correctly, but because the files are reported to have the wrong MIME type they can get blocked by the browser.

This PR tells nginx that mjs files are, like js files, to be reported as application/javascript.

* otherwise, nginx may fall back to using "application/octet-stream"
  which browsers may not like
@max-moser
Copy link
Contributor Author

Very similar issue (which also served as inspiration for this PR): storybookjs/storybook#20157

@ntarocco ntarocco merged commit 7a553f9 into inveniosoftware:master Dec 11, 2024
@max-moser max-moser deleted the mm/nginx-mjs branch December 11, 2024 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants