FIX: Escaped mailto URLs would raise an exception

This prevents exceptions from being raised if a URL has an invalid
component.
This commit is contained in:
Robin Ward
2020-10-05 14:12:33 -04:00
parent 39ad9a4734
commit 00afd308c1
2 changed files with 6 additions and 1 deletions

View File

@ -205,5 +205,10 @@ describe UrlHelper do
url = "http://URL:%20https://google.com"
expect(described_class.rails_route_from_url(url)).to eq(nil)
end
it "does not raise for invalid mailtos" do
url = "mailto:eviltrout%2540example.com"
expect(described_class.rails_route_from_url(url)).to eq(nil)
end
end
end