From ae3f98c51b2790f6f3a600ff465255417e3d865d Mon Sep 17 00:00:00 2001 From: An Long Date: Fri, 6 Mar 2020 23:31:35 +0000 Subject: [PATCH] mime: add .json to built-in list of MIME types MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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í TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/mime/type.go | 1 + 1 file changed, 1 insertion(+) 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", -- 2.50.0