修复GET302和POST307关闭连接后无法响应的问题

This commit is contained in:
GoEdgeLab
2023-03-06 16:10:58 +08:00
parent 2ba63a85c1
commit ec53263a74
2 changed files with 22 additions and 15 deletions

View File

@@ -69,14 +69,14 @@ func (this *Get302Action) Perform(waf *WAF, group *RuleGroup, set *RuleSet, requ
http.Redirect(writer, request.WAFRaw(), Get302Path+"?info="+url.QueryEscape(info), http.StatusFound)
if request.WAFRaw().ProtoMajor == 1 {
flusher, ok := writer.(http.Flusher)
if ok {
flusher.Flush()
}
request.WAFClose()
flusher, ok := writer.(http.Flusher)
if ok {
flusher.Flush()
}
// 延迟等待响应发送完毕
time.Sleep(1 * time.Second)
request.WAFClose()
return false, false
}