danbooru::http: fix SSLError exceptions not being caught.
Bug: The frontpage failed due to a SSL error. We couldn't fetch the popular tag list from Reportbooru because Reportbooru's SSL certificate had expired and HTTP.rb raised an SSLError exception that we didn't catch. Fix: Convert the SSLError to a 5xx HTTP error to prevent SSL exceptions from leaking through HTTP.rb.
This commit is contained in:
@@ -120,11 +120,17 @@ module Danbooru
|
||||
|
||||
def request(method, url, **options)
|
||||
http.send(method, url, **options)
|
||||
rescue OpenSSL::SSL::SSLError
|
||||
fake_response(590, "")
|
||||
rescue ValidatingSocket::ProhibitedIpError
|
||||
fake_response(597, "")
|
||||
fake_response(591, "")
|
||||
rescue HTTP::Redirector::TooManyRedirectsError
|
||||
fake_response(598, "")
|
||||
fake_response(596, "")
|
||||
rescue HTTP::TimeoutError
|
||||
fake_response(597, "")
|
||||
rescue HTTP::ConnectionError
|
||||
fake_response(598, "")
|
||||
rescue HTTP::Error
|
||||
fake_response(599, "")
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user