mirror of
https://gitgud.io/fatchan/haproxy-protection.git
synced 2025-05-09 02:05:37 +00:00
haproxy snapshot fixes bug, and use url biuld query to make body for hcaptcha post
This commit is contained in:
@ -144,7 +144,7 @@ function _M.view(applet)
|
||||
"https://%s/siteverify",
|
||||
core.backends["hcaptcha"].servers["hcaptcha"]:get_addr()
|
||||
)
|
||||
local hcaptcha_body = json.encode({
|
||||
local hcaptcha_body = url.buildQuery({
|
||||
secret=captcha_secret,
|
||||
response=parsed_body["h-captcha-response"]
|
||||
})
|
||||
@ -154,11 +154,12 @@ function _M.view(applet)
|
||||
body=hcaptcha_body,
|
||||
headers={
|
||||
[ "host" ] = { captcha_provider_domain },
|
||||
[ "content-type" ] = { "application/json" }
|
||||
[ "content-type" ] = { "application/x-www-form-urlencoded" }
|
||||
}
|
||||
}
|
||||
local status, api_response = pcall(json.decode, res.body)
|
||||
--require("print_r")
|
||||
--print_r(hcaptcha_body)
|
||||
--print_r(res)
|
||||
--print_r(api_response)
|
||||
if not status then
|
||||
|
Reference in New Issue
Block a user