Add no cache headers (#47)
This commit is contained in:
parent
cd881cb387
commit
f44ea23d5e
2 changed files with 2 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue