diff --git a/doc/go1.19.html b/doc/go1.19.html index a83a916c72..c809e10551 100644 --- a/doc/go1.19.html +++ b/doc/go1.19.html @@ -216,6 +216,22 @@ Do not send CLs removing the interior tags from such phrases. +
+ On Windows only, the mime package now ignores a registry entry
+ recording that the extension .js
should have MIME
+ type text/plain
. This is a common unintentional
+ misconfiguration on Windows systems. The effect is
+ that .js
will have the default MIME
+ type text/javascript; charset=utf-8
.
+ Applications that expect text/plain
on Windows must
+ now explicitly call
+ AddExtensionType
.
+
diff --git a/src/mime/type_windows.go b/src/mime/type_windows.go index cee9c9db04..93802141c5 100644 --- a/src/mime/type_windows.go +++ b/src/mime/type_windows.go @@ -30,6 +30,17 @@ func initMimeWindows() { if err != nil { continue } + + // There is a long-standing problem on Windows: the + // registry sometimes records that the ".js" extension + // should be "text/plain". See issue #32350. While + // normally local configuration should override + // defaults, this problem is common enough that we + // handle it here by ignoring that registry setting. + if name == ".js" && (v == "text/plain" || v == "text/plain; charset=utf-8") { + continue + } + setExtensionType(name, v) } }