WAF get302和post307只有在HTTP/1的情况下才在跳转前关闭连接

This commit is contained in:
GoEdgeLab
2021-07-26 14:33:06 +08:00
parent b7942c3844
commit bb86523837
2 changed files with 6 additions and 3 deletions

View File

@@ -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
}

View File

@@ -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
}