mirror of
https://github.com/discourse/discourse.git
synced 2025-02-17 01:52:45 +08:00
FIX: Strip whitespace from URL before validating (#12174)
This commit is contained in:
parent
13c2a4886f
commit
a9a93b15ec
|
@ -15,7 +15,7 @@ class TopicRetriever
|
||||||
private
|
private
|
||||||
|
|
||||||
def invalid_url?
|
def invalid_url?
|
||||||
!EmbeddableHost.url_allowed?(@embed_url)
|
!EmbeddableHost.url_allowed?(@embed_url.strip)
|
||||||
end
|
end
|
||||||
|
|
||||||
def retrieved_recently?
|
def retrieved_recently?
|
||||||
|
|
|
@ -63,6 +63,11 @@ describe TopicRetriever do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "works with URLs with whitespaces" do
|
||||||
|
expect { TopicRetriever.new(" https://example.com ").retrieve }
|
||||||
|
.not_to raise_error
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user