-
Notifications
You must be signed in to change notification settings - Fork 127
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
runJs: correct MIME type for JavaScript modules #1567
Conversation
@@ -175,6 +175,7 @@ fun File.miniMimeType() = when (this.extension.toLowerCase()) { | |||
"svg" -> "image/svg+xml" | |||
"mp3" -> "audio/mpeg" | |||
"wasm" -> "application/wasm" | |||
"mjs" -> "text/javascript" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe ”js”, “mjs” ->
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
js
is correctly recognized by Files.probeContentType
. But I can add it for completeness' sake.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, add it too. In the end we cannot control directly which files are detected. Probably PNG and HTML are already detected but are there also. Maybe newer JVM versions are already providing the right mime-types. But since we are providing others too, let's provide all the ones that we might want to serve so this is complete.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done👌
Codecov ReportPatch coverage has no change and project coverage change:
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more Additional details and impacted files@@ Coverage Diff @@
## main #1567 +/- ##
==========================================
- Coverage 51.22% 51.20% -0.02%
==========================================
Files 1672 1672
Lines 98741 98742 +1
Branches 14117 14118 +1
==========================================
- Hits 50581 50564 -17
- Misses 44297 44301 +4
- Partials 3863 3877 +14
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
Thanks! |
Similar to this one, but now for the commonly used JavaScript
*.mjs
module files.