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
|
task :update_disposable_email_blacklist => [:environment] do
|
||||||
# Formerly: https://raw.githubusercontent.com/martenson/disposable-email-domains/master/disposable_email_blocklist.conf
|
# 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')
|
uri = URI.parse('https://raw.githubusercontent.com/disposable/disposable-email-domains/master/domains.txt')
|
||||||
|
File.write(Site::DISPOSABLE_EMAIL_BLACKLIST_PATH, HTTP.get(uri))
|
||||||
File.write(Site::DISPOSABLE_EMAIL_BLACKLIST_PATH, Net::HTTP.get(uri))
|
|
||||||
end
|
end
|
||||||
|
|
||||||
desc 'Update banned IPs list'
|
desc 'Update banned IPs list'
|
||||||
|
|
|
@ -108,13 +108,10 @@ def hcaptcha_valid?
|
||||||
return true if ENV['RACK_ENV'] == 'test' || ENV['CI']
|
return true if ENV['RACK_ENV'] == 'test' || ENV['CI']
|
||||||
return false unless params[:'h-captcha-response']
|
return false unless params[:'h-captcha-response']
|
||||||
|
|
||||||
resp = Net::HTTP.get URI(
|
resp = HTTP.get('https://hcaptcha.com/siteverify', params: {
|
||||||
'https://hcaptcha.com/siteverify?'+
|
secret: $config['hcaptcha_secret_key'],
|
||||||
Rack::Utils.build_query(
|
response: params[:'h-captcha-response']
|
||||||
secret: $config['hcaptcha_secret_key'],
|
})
|
||||||
response: params[:'h-captcha-response']
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
resp = JSON.parse resp
|
resp = JSON.parse resp
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue