mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 20:04:42 +08:00
FIX: Swallow SSL errors when generating oneboxes
This commit is contained in:

committed by
Loïc Guitaut

parent
14cc67c9b2
commit
afe7785141
@ -470,6 +470,23 @@ RSpec.describe FinalDestination do
|
||||
expect(get).to be_blank
|
||||
end
|
||||
end
|
||||
|
||||
context "when there is an SSL error" do
|
||||
subject(:get) { fd.get {} }
|
||||
|
||||
before do
|
||||
fd.stubs(:safe_session).raises(OpenSSL::SSL::SSLError)
|
||||
end
|
||||
|
||||
it "logs the exception" do
|
||||
Rails.logger.expects(:warn).with(regexp_matches(/an error with ssl occurred/i))
|
||||
get
|
||||
end
|
||||
|
||||
it "returns nothing" do
|
||||
expect(get).to be_blank
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe '.validate_uri' do
|
||||
|
Reference in New Issue
Block a user