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

@ -31,8 +31,7 @@ desc 'Update disposable email blacklist'
task :update_disposable_email_blacklist => [:environment] do
# Formerly: https://raw.githubusercontent.com/martenson/disposable-email-domains/master/disposable_email_blocklist.conf
uri = URI.parse('https://raw.githubusercontent.com/disposable/disposable-email-domains/master/domains.txt')
File.write(Site::DISPOSABLE_EMAIL_BLACKLIST_PATH, Net::HTTP.get(uri))
File.write(Site::DISPOSABLE_EMAIL_BLACKLIST_PATH, HTTP.get(uri))
end
desc 'Update banned IPs list'

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(
resp = HTTP.get('https://hcaptcha.com/siteverify', params: {
secret: $config['hcaptcha_secret_key'],
response: params[:'h-captcha-response']
)
)
})
resp = JSON.parse resp