Explorar o código

fix(internal): register mime type for .mjs files (#577)

Closes #575

I'm gonna be totally honest, I'm not sure if this is needed. However,
measure twice, cut once.

Signed-off-by: Xe Iaso <me@xeiaso.net>
Xe Iaso hai 1 mes
pai
achega
669671bd46
Modificáronse 2 ficheiros con 8 adicións e 0 borrados
  1. 1 0
      docs/docs/CHANGELOG.md
  2. 7 0
      internal/mimetype.go

+ 1 - 0
docs/docs/CHANGELOG.md

@@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 - Rename cookies in response to user feedback
 - Ensure cookie renaming is consistent across configuration options
 - Add Bookstack app in data
+- Ensure client JavaScript is served with Content-Type text/javascript.
 - Add `--target-host` flag/envvar to allow changing the value of the Host header in requests forwarded to the target service.
 - Bump AI-robots.txt to version 1.31
 - Add `RuntimeDirectory` to systemd unit settings so native packages can listen over unix sockets

+ 7 - 0
internal/mimetype.go

@@ -0,0 +1,7 @@
+package internal
+
+import "mime"
+
+func init() {
+	mime.AddExtensionType(".mjs", "text/javascript")
+}