Skip to content

Commit

Permalink
增加更多替换支持类型
Browse files Browse the repository at this point in the history
  • Loading branch information
Becivells committed Sep 13, 2021
1 parent 51f3637 commit 61d40a3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/plugin/replace/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ import (
log "unknwon.dev/clog/v2"
)

//strings.HasPrefix("image",conType)||strings.HasPrefix("video",conType)||strings.HasPrefix("audio",conType)||strings.HasPrefix("application/octet",conType)
var allowType = []string{"text", "application/json"}
// https://annevankesteren.nl/2005/02/javascript-mime-type
// todo 移动至配置文件
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"}

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

0 comments on commit 61d40a3

Please sign in to comment.