]> Cypherpunks repositories - gostls13.git/commitdiff
mime: add javascript module mime type (.mjs)
authorJohn <johnchristian@hotmail.es>
Wed, 27 Mar 2019 17:30:32 +0000 (17:30 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 27 Mar 2019 17:30:53 +0000 (17:30 +0000)
There are default mime types in this package for handling static content, but there's
a new one missing ".mjs"  that is "Content-Type: text/javascript".

https://developers.google.com/web/fundamentals/primers/modules#mjs

Change-Id: Ie842ece0cb55770fb6c9eb65f8bfee2ecf7bc624
GitHub-Last-Rev: e26d9f76171c987112d5d6db292446819a8393e2
GitHub-Pull-Request: golang/go#31071
Reviewed-on: https://go-review.googlesource.com/c/go/+/169502
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/mime/type.go

index 64e26ffb7cc900f9d68d4badb8c170e996051c3e..3a8fe4447fa346b6c58902d2ca0a1161efa01bd2 100644 (file)
@@ -68,6 +68,7 @@ var builtinTypesLower = map[string]string{
        ".png":  "image/png",
        ".svg":  "image/svg+xml",
        ".xml":  "text/xml; charset=utf-8",
+       ".mjs":  "text/javascript",
 }
 
 var once sync.Once // guards initMime