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 }