aboutsummaryrefslogtreecommitdiff
path: root/src/mime
diff options
context:
space:
mode:
authorAn Long <aisk1988@gmail.com>2020-03-06 23:31:35 +0000
committerDaniel Martí <mvdan@mvdan.cc>2020-03-07 00:35:52 +0000
commitae3f98c51b2790f6f3a600ff465255417e3d865d (patch)
treef29900d89a81674d15ab72b5baa9d9ca2e89c523 /src/mime
parentb00ebeaebcd8d7535ff08163a7907a6a8fe7b703 (diff)
downloadgo-ae3f98c51b2790f6f3a600ff465255417e3d865d.tar.gz
go-ae3f98c51b2790f6f3a600ff465255417e3d865d.zip
mime: add .json to built-in list of MIME types
Since json is popular and mime package's builtin type does not contain it, and some Linux distributions do not contain the '/etc/mime.types' file with minimal installations. Change-Id: I933393c82be296ef176206c253f4dd19b6f33bb1 GitHub-Last-Rev: ce4eae56a4d468631555dc85e0e7ab4bbd0ef45d GitHub-Pull-Request: golang/go#34737 Reviewed-on: https://go-review.googlesource.com/c/go/+/199657 Run-TryBot: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/mime')
-rw-r--r--src/mime/type.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/mime/type.go b/src/mime/type.go
index 260c535af0..6d2b89e405 100644
--- a/src/mime/type.go
+++ b/src/mime/type.go
@@ -65,6 +65,7 @@ var builtinTypesLower = map[string]string{
".jpeg": "image/jpeg",
".jpg": "image/jpeg",
".js": "text/javascript; charset=utf-8",
+ ".json": "application/json",
".mjs": "text/javascript; charset=utf-8",
".pdf": "application/pdf",
".png": "image/png",