From bb86523837a7507909d9c33fc0399c20e34245ca Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Mon, 26 Jul 2021 14:33:06 +0800 Subject: [PATCH] =?UTF-8?q?WAF=20get302=E5=92=8Cpost307=E5=8F=AA=E6=9C=89?= =?UTF-8?q?=E5=9C=A8HTTP/1=E7=9A=84=E6=83=85=E5=86=B5=E4=B8=8B=E6=89=8D?= =?UTF-8?q?=E5=9C=A8=E8=B7=B3=E8=BD=AC=E5=89=8D=E5=85=B3=E9=97=AD=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/waf/action_get_302.go | 4 +++- internal/waf/action_post_307.go | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/internal/waf/action_get_302.go b/internal/waf/action_get_302.go index 304d310..8cf37d6 100644 --- a/internal/waf/action_get_302.go +++ b/internal/waf/action_get_302.go @@ -65,7 +65,9 @@ func (this *Get302Action) Perform(waf *WAF, group *RuleGroup, set *RuleSet, requ http.Redirect(writer, request.WAFRaw(), Get302Path+"?info="+url.QueryEscape(info), http.StatusFound) // 关闭连接 - _ = this.CloseConn(writer) + if request.WAFRaw().ProtoMajor == 1 { + _ = this.CloseConn(writer) + } return true } diff --git a/internal/waf/action_post_307.go b/internal/waf/action_post_307.go index 22a4dc1..cfc0bb5 100644 --- a/internal/waf/action_post_307.go +++ b/internal/waf/action_post_307.go @@ -81,8 +81,9 @@ func (this *Post307Action) Perform(waf *WAF, group *RuleGroup, set *RuleSet, req http.Redirect(writer, request.WAFRaw(), request.WAFRaw().URL.String(), http.StatusTemporaryRedirect) - // 关闭连接 - _ = this.CloseConn(writer) + if request.WAFRaw().ProtoMajor == 1 { + _ = this.CloseConn(writer) + } return true }