Chore: builtin right mime of .js (#1808)
This commit is contained in:
parent
08607fb6b4
commit
78e105f3b2
16
constant/mime/mime.go
Normal file
16
constant/mime/mime.go
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
package mime
|
||||||
|
|
||||||
|
import (
|
||||||
|
"mime"
|
||||||
|
)
|
||||||
|
|
||||||
|
var consensusMimes = map[string]string{
|
||||||
|
// rfc4329: text/javascript is obsolete, so we need to overwrite mime's builtin
|
||||||
|
".js": "application/javascript; charset=utf-8",
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
for ext, typ := range consensusMimes {
|
||||||
|
mime.AddExtensionType(ext, typ)
|
||||||
|
}
|
||||||
|
}
|
@ -9,6 +9,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
C "github.com/Dreamacro/clash/constant"
|
C "github.com/Dreamacro/clash/constant"
|
||||||
|
_ "github.com/Dreamacro/clash/constant/mime"
|
||||||
"github.com/Dreamacro/clash/log"
|
"github.com/Dreamacro/clash/log"
|
||||||
"github.com/Dreamacro/clash/tunnel/statistic"
|
"github.com/Dreamacro/clash/tunnel/statistic"
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user