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