mirror of
https://github.com/neocities/neocities.git
synced 2025-05-20 19:29:36 +02:00
convert net::http calls to http gem
This commit is contained in:
parent
be6c4252ff
commit
ca71db54ba
2 changed files with 5 additions and 9 deletions
3
Rakefile
3
Rakefile
|
@ -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'
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue