[优化] 修复基本鉴权逻辑,确保 Lua 块正确关闭并添加相关测试用例

This commit is contained in:
ryan
2026-05-26 10:29:40 +08:00
parent 048f6e4535
commit 8853933adc
2 changed files with 49 additions and 1 deletions
+1 -1
View File
@@ -1135,7 +1135,7 @@ func renderBasicAuthBlock(enabled bool, username, password string) string {
if auth ~= "Basic %s" then
ngx.header["WWW-Authenticate"] = 'Basic realm="Restricted"'
return ngx.exit(401)
}
end
}
`, encoded)
}