Merge pull request #631 from bunkerity/dev

Fix error with the CSP header override of the antibot
This commit is contained in:
Théophile Diot 2023-09-08 18:17:15 +02:00 committed by GitHub
commit fd79508633
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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"