Skip to content

Commit

Permalink
add "; charset=utf-8" to json and xhtml
Browse files Browse the repository at this point in the history
  • Loading branch information
evanw committed Apr 10, 2023
1 parent 64edd89 commit 7985bca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/bundler_tests/snapshots/snapshots_loader.txt
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ var example_default7 = "data:image/jpeg,jpg";
var example_default8 = "data:text/javascript;charset=utf-8,js";

// example.json
var example_default9 = "data:application/json,json";
var example_default9 = "data:application/json;charset=utf-8,json";

// example.mjs
var example_default10 = "data:text/javascript;charset=utf-8,mjs";
Expand Down
4 changes: 2 additions & 2 deletions internal/helpers/mime.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ var builtinTypesLower = map[string]string{
".htm": "text/html; charset=utf-8",
".html": "text/html; charset=utf-8",
".js": "text/javascript; charset=utf-8",
".json": "application/json",
".json": "application/json; charset=utf-8",
".markdown": "text/markdown; charset=utf-8",
".md": "text/markdown; charset=utf-8",
".mjs": "text/javascript; charset=utf-8",
".xhtml": "application/xhtml+xml",
".xhtml": "application/xhtml+xml; charset=utf-8",
".xml": "text/xml; charset=utf-8",

// Images
Expand Down

0 comments on commit 7985bca

Please sign in to comment.