Skip to content

Commit

Permalink
runJs: correct MIME type for JavaScript modules (#1567)
Browse files Browse the repository at this point in the history
* runJs: correct MIME type for JavaScript modules

* Add MIME type for js files as well
  • Loading branch information
smaugfm authored May 3, 2023
1 parent a1c2305 commit 0f0b25c
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ fun File.miniMimeType() = when (this.extension.toLowerCase()) {
"svg" -> "image/svg+xml"
"mp3" -> "audio/mpeg"
"wasm" -> "application/wasm"
"js", "mjs" -> "text/javascript"
else -> if (this.exists()) Files.probeContentType(this.toPath()) ?: "application/octet-stream" else "text/plain"
}

Expand Down

0 comments on commit 0f0b25c

Please sign in to comment.