[优化] 添加 WAF 阻止逻辑以短路 PoW 处理,更新测试以验证新行为

This commit is contained in:
ryan
2026-05-30 15:46:34 +08:00
parent e094f4a3b7
commit d619deec96
3 changed files with 6 additions and 2 deletions
@@ -1265,6 +1265,9 @@ func renderAccessBlock(siteName string, powEnabled bool) string {
return fmt.Sprintf(` set $openflare_waf_site "%s";
access_by_lua_block {
dofile("%s/waf/check.lua")
if ngx.ctx.openflare_waf_blocked then
return
end
dofile("%s/pow/check.lua")
}
`, escapedSiteName, nginxLuaDirPlaceholder, nginxLuaDirPlaceholder)