From af3fa25a14812b3f3d5c0999b2d02dbea977bd99 Mon Sep 17 00:00:00 2001 From: alteredCoder Date: Wed, 26 Jan 2022 17:36:44 +0100 Subject: [PATCH] update --- nginx/crowdsec.lua | 3 +++ nginx/recaptcha.lua | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/nginx/crowdsec.lua b/nginx/crowdsec.lua index 8da534b..7711937 100644 --- a/nginx/crowdsec.lua +++ b/nginx/crowdsec.lua @@ -314,6 +314,9 @@ function csmod.Allow(ip) local recaptcha_res = ngx.req.get_post_args()["g-recaptcha-response"] or 0 if recaptcha_res ~= 0 then valid, err = cs.validateCaptcha(recaptcha_res, ngx.var.remote_addr) + if err ~= nil then + ngx.log(ngx.ERR, "Error while validating captcha: " .. err) + end if valid == true then ngx.shared.crowdsec_cache:set("captcha_"..ngx.var.remote_addr, "/" , 10, recaptcha.GetStateID(recaptcha._VALIDATED_STATE)) ngx.req.set_method(ngx.HTTP_GET) diff --git a/nginx/recaptcha.lua b/nginx/recaptcha.lua index 01db711..906d6d8 100644 --- a/nginx/recaptcha.lua +++ b/nginx/recaptcha.lua @@ -73,7 +73,7 @@ function M.Validate(g_captcha_res, remote_ip) local httpc = http.new() - httpc:set_timeout(0.2) + httpc:set_timeout(3) local res, err = httpc:request_uri(recaptcha_verify_url, { method = "POST",