FIX: URLs containing two # would fail to work

Some URLs in browsers are non compliant and contain twos `#` this commit adds
special handling for this edge case by auto encoding any fragments containing `#`
This commit is contained in:
Sam
2018-12-11 18:03:13 +11:00
parent bb4ef644bf
commit 671469bcc7
6 changed files with 47 additions and 26 deletions

View File

@ -3,6 +3,15 @@ require_dependency 'url_helper'
describe UrlHelper do
describe "#relaxed parse" do
it "can handle double #" do
url = UrlHelper.relaxed_parse("https://test.com#test#test")
expect(url.to_s).to eq("https://test.com#test%23test")
end
end
describe "#is_local" do
it "is true when the file has been uploaded" do