Add no cache headers (#47)

This commit is contained in:
Laurence Jones 2023-10-23 15:53:15 +01:00 committed by GitHub
parent cd881cb387
commit f44ea23d5e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View file

@ -521,6 +521,7 @@ function csmod.Allow(ip)
-- we check if the IP is already in cache for captcha and not yet validated
if previous_uri == nil or state_id ~= captcha.GetStateID(captcha._VALIDATED_STATE) then
ngx.header.content_type = "text/html"
ngx.header.cache_control = "no-cache"
ngx.say(csmod.GetCaptchaTemplate())
local uri = ngx.var.uri
-- in case its not a GET request, we prefer to fallback on referer

View file

@ -49,6 +49,7 @@ function M.apply()
end
if M.template_str ~= "" then
ngx.header.content_type = "text/html"
ngx.header.cache_control = "no-cache"
ngx.status = M.ret_code
ngx.say(M.template_str)
ngx.exit(M.ret_code)