mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 17:40:43 +08:00
FIX: Skip absolutizing URLs when source URI is invalid
This commit is contained in:
@ -310,4 +310,14 @@ describe TopicEmbed do
|
||||
end
|
||||
end
|
||||
|
||||
describe '.absolutize_urls' do
|
||||
let(:invalid_url) { 'http://source.com/#double#anchor' }
|
||||
let(:contents) { "hello world new post <a href='/hello'>hello</a>" }
|
||||
|
||||
it "does not attempt absolutizing on a bad URI" do
|
||||
raw = TopicEmbed.absolutize_urls(invalid_url, contents)
|
||||
expect(raw).to eq(contents)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user