convert net::http calls to http gem

This commit is contained in:
Kyle Drake 2024-04-10 12:59:31 -05:00
parent be6c4252ff
commit ca71db54ba
2 changed files with 5 additions and 9 deletions

View file

@ -108,13 +108,10 @@ def hcaptcha_valid?
return true if ENV['RACK_ENV'] == 'test' || ENV['CI']
return false unless params[:'h-captcha-response']
resp = Net::HTTP.get URI(
'https://hcaptcha.com/siteverify?'+
Rack::Utils.build_query(
secret: $config['hcaptcha_secret_key'],
response: params[:'h-captcha-response']
)
)
resp = HTTP.get('https://hcaptcha.com/siteverify', params: {
secret: $config['hcaptcha_secret_key'],
response: params[:'h-captcha-response']
})
resp = JSON.parse resp