From 61d40a3ae5d8fc5a17e62ee693388ee66895cd5f Mon Sep 17 00:00:00 2001 From: becivells <732903873@qq.com> Date: Tue, 14 Sep 2021 07:37:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=9B=B4=E5=A4=9A=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2=E6=94=AF=E6=8C=81=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/plugin/replace/response.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/plugin/replace/response.go b/internal/plugin/replace/response.go index 0e7d52e..fc08590 100644 --- a/internal/plugin/replace/response.go +++ b/internal/plugin/replace/response.go @@ -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 {