Skip to content

Commit 61d40a3

Browse files
committed
增加更多替换支持类型
1 parent 51f3637 commit 61d40a3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

internal/plugin/replace/response.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ import (
1212
log "unknwon.dev/clog/v2"
1313
)
1414

15-
//strings.HasPrefix("image",conType)||strings.HasPrefix("video",conType)||strings.HasPrefix("audio",conType)||strings.HasPrefix("application/octet",conType)
16-
var allowType = []string{"text", "application/json"}
15+
// https://annevankesteren.nl/2005/02/javascript-mime-type
16+
// todo 移动至配置文件
17+
var allowType = []string{"text", "application/json", "application/javascript", "application/x-javascript", "message", "application/hta", "application/rtf", "application/ecmascript", "image/svg+xml", "application/xhtml", "application/xml"}
1718

1819
func (rpRule *Response) Response(maxContentLength int, response *http.Response) error {
1920
if rpRule == nil {

0 commit comments

Comments
 (0)