Skip to content

Commit

Permalink
rename application/javascript to text/javascript (#604)
Browse files Browse the repository at this point in the history
In accordance with latest IANA specification and with what go sdtlib is
doing.
https://www.iana.org/assignments/media-types/text/javascript
  • Loading branch information
gabriel-vasile authored Nov 11, 2024
1 parent bd7617a commit 4c93ad3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion mimetype_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ var testcases = []testcase{
{"jxl 2", "\x00\x00\x00\x0cJXL\x20\x0d\x0a\x87\x0a", "image/jxl", false},
{"jxr", "\x49\x49\xBC\x01", "image/jxr", true},
{"xpm", "\x2F\x2A\x20\x58\x50\x4D\x20\x2A\x2F", "image/x-xpixmap", true},
{"js", "#!/bin/node ", "application/javascript", true},
{"js", "#!/bin/node ", "text/javascript", true},
{"json", `{"key":"val"}`, "application/json", true},
{"json issue#239", "{\x0A\x09\x09\"key\":\"val\"}\x0A", "application/json", false},
// json.{int,string}.txt contain a single JSON value. They are valid JSON
Expand Down
2 changes: 1 addition & 1 deletion supported_mimes.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ Extension | MIME type | Aliases
**.xfdf** | application/vnd.adobe.xfdf | -
**.owl** | application/owl+xml | -
**.php** | text/x-php | -
**.js** | application/javascript | application/x-javascript, text/javascript
**.js** | text/javascript | application/x-javascript, application/javascript
**.lua** | text/x-lua | -
**.pl** | text/x-perl | -
**.py** | text/x-python | text/x-script.python, application/x-python
Expand Down
4 changes: 2 additions & 2 deletions tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ var (
html = newMIME("text/html", ".html", magic.HTML)
php = newMIME("text/x-php", ".php", magic.Php)
rtf = newMIME("text/rtf", ".rtf", magic.Rtf).alias("application/rtf")
js = newMIME("application/javascript", ".js", magic.Js).
alias("application/x-javascript", "text/javascript")
js = newMIME("text/javascript", ".js", magic.Js).
alias("application/x-javascript", "application/javascript")
srt = newMIME("application/x-subrip", ".srt", magic.Srt).
alias("application/x-srt", "text/x-srt")
vtt = newMIME("text/vtt", ".vtt", magic.Vtt)
Expand Down

0 comments on commit 4c93ad3

Please sign in to comment.