update
This commit is contained in:
parent
a4706a9fc3
commit
1337100488
1 changed files with 3 additions and 3 deletions
|
@ -3,6 +3,8 @@ local http = require "resty.http"
|
||||||
|
|
||||||
local M = {_TYPE='module', _NAME='recaptcha.funcs', _VERSION='1.0-0'}
|
local M = {_TYPE='module', _NAME='recaptcha.funcs', _VERSION='1.0-0'}
|
||||||
|
|
||||||
|
local recaptcha_verify_url = "https://www.google.com/recaptcha/api/siteverify"
|
||||||
|
|
||||||
M._VERIFY_STATE = "to_verify"
|
M._VERIFY_STATE = "to_verify"
|
||||||
M._VALIDATED_STATE = "validated"
|
M._VALIDATED_STATE = "validated"
|
||||||
|
|
||||||
|
@ -73,15 +75,13 @@ function M.Validate(g_captcha_res, remote_ip)
|
||||||
|
|
||||||
httpc:set_timeout(1)
|
httpc:set_timeout(1)
|
||||||
|
|
||||||
local res, err = httpc:request_uri(link, {
|
local res, err = httpc:request_uri(recaptcha_verify_url, {
|
||||||
method = "POST",
|
method = "POST",
|
||||||
body = body,
|
body = body,
|
||||||
headers = {
|
headers = {
|
||||||
["Content-Type"] = "application/x-www-form-urlencoded",
|
["Content-Type"] = "application/x-www-form-urlencoded",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
res, err = post_http_request(recaptcha_verify_url, table_to_encoded_url(body))
|
|
||||||
if err ~= nil then
|
if err ~= nil then
|
||||||
return true, err
|
return true, err
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue