Skip to content

Commit

Permalink
mime: update type of .js and .mjs files to text/javascript
Browse files Browse the repository at this point in the history
application/javascript is being deprecated per
https://datatracker.ietf.org/doc/draft-ietf-dispatch-javascript-mjs/

Specify a charset to be consistent with other text/* mime types.

Fixes #32351

Change-Id: I7300f6cfdbcf574103764991cb75172a252a3400
Reviewed-on: https://go-review.googlesource.com/c/go/+/186927
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
  • Loading branch information
andybons authored and mvdan committed Sep 1, 2019
1 parent 54a9c16 commit 99df76f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mime/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ var builtinTypesLower = map[string]string{
".html": "text/html; charset=utf-8",
".jpeg": "image/jpeg",
".jpg": "image/jpeg",
".js": "application/javascript",
".mjs": "application/javascript",
".js": "text/javascript; charset=utf-8",
".mjs": "text/javascript; charset=utf-8",
".pdf": "application/pdf",
".png": "image/png",
".svg": "image/svg+xml",
Expand Down

0 comments on commit 99df76f

Please sign in to comment.