mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 02:48:28 +08:00
FIX: Okay, add support for hosts that have trailing paths
This commit is contained in:
@ -68,7 +68,7 @@ describe EmbedController do
|
||||
|
||||
context "with multiple hosts" do
|
||||
before do
|
||||
SiteSetting.embeddable_hosts = "#{host}\nhttp://discourse.org"
|
||||
SiteSetting.embeddable_hosts = "#{host}\nhttp://discourse.org\nhttps://example.com/1234"
|
||||
end
|
||||
|
||||
context "success" do
|
||||
@ -84,6 +84,12 @@ describe EmbedController do
|
||||
expect(response).to be_success
|
||||
end
|
||||
|
||||
it "works with a host with a path" do
|
||||
controller.request.stubs(:referer).returns("https://example.com/some-other-path")
|
||||
get :comments, embed_url: embed_url
|
||||
expect(response).to be_success
|
||||
end
|
||||
|
||||
it "doesn't work with a made up host" do
|
||||
controller.request.stubs(:referer).returns("http://codinghorror.com/invalid-url")
|
||||
get :comments, embed_url: embed_url
|
||||
|
Reference in New Issue
Block a user