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

runJs: correct MIME type for JavaScript modules #1567

Merged
merged 2 commits into from
May 3, 2023
Merged

runJs: correct MIME type for JavaScript modules #1567

merged 2 commits into from
May 3, 2023

Conversation

smaugfm
Copy link
Contributor

@smaugfm smaugfm commented May 3, 2023

Similar to this one, but now for the commonly used JavaScript *.mjs module files.

@@ -175,6 +175,7 @@ fun File.miniMimeType() = when (this.extension.toLowerCase()) {
"svg" -> "image/svg+xml"
"mp3" -> "audio/mpeg"
"wasm" -> "application/wasm"
"mjs" -> "text/javascript"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe ”js”, “mjs” ->?

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done👌

@codecov-commenter
Copy link

Codecov Report

Patch coverage has no change and project coverage change: -0.02 ⚠️

Comparison is base (a1c2305) 51.22% compared to head (982d356) 51.20%.

📣 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     
Flag Coverage Δ
unittests 51.20% <0.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...otlin/korlibs/korge/gradle/util/HttpServerTools.kt 0.00% <0.00%> (ø)

... and 19 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@soywiz soywiz merged commit 0f0b25c into korlibs:main May 3, 2023
@soywiz
Copy link
Member

soywiz commented May 3, 2023

Thanks!

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.

3 participants