Fix error with the CSP header override of the antibot

This commit is contained in:
Théophile Diot 2023-09-08 17:18:08 +02:00
parent ea6ae52539
commit 3ae9636d5a
No known key found for this signature in database
GPG key ID: 248FEA4BAE400D06

View file

@ -47,6 +47,11 @@ function antibot:header()
return self:ret(true, "client already resolved the challenge")
end
if self.ctx.bw.uri ~= self.variables["ANTIBOT_URI"] then
return self:ret(true, "Not antibot uri")
end
local header = "Content-Security-Policy"
if self.variables["CONTENT_SECURITY_POLICY_REPORT_ONLY"] == "yes" then
header = header .. "-Report-Only"