mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FIX: Embedding was broken with non-english URLs and ports
This commit is contained in:
@ -49,12 +49,21 @@ describe EmbeddableHost do
|
||||
expect(eh).not_to be_valid
|
||||
end
|
||||
|
||||
describe "it works with ports" do
|
||||
let!(:host) { Fabricate(:embeddable_host, host: 'localhost:8000') }
|
||||
|
||||
it "works as expected" do
|
||||
expect(EmbeddableHost.url_allowed?('http://localhost:8000/eviltrout')).to eq(true)
|
||||
end
|
||||
end
|
||||
|
||||
describe "url_allowed?" do
|
||||
let!(:host) { Fabricate(:embeddable_host) }
|
||||
|
||||
it 'works as expected' do
|
||||
expect(EmbeddableHost.url_allowed?('http://eviltrout.com')).to eq(true)
|
||||
expect(EmbeddableHost.url_allowed?('https://eviltrout.com')).to eq(true)
|
||||
expect(EmbeddableHost.url_allowed?('https://eviltrout.com/انگلیسی')).to eq(true)
|
||||
expect(EmbeddableHost.url_allowed?('https://not-eviltrout.com')).to eq(false)
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user