diff --git a/app/helpers/url_helpers.rb b/app/helpers/url_helpers.rb index 9d4c6fc7e..6c3a97bef 100644 --- a/app/helpers/url_helpers.rb +++ b/app/helpers/url_helpers.rb @@ -25,11 +25,11 @@ def expand_absolute_urls(content, base_url) end def normalize_url(url, base_url) - uri = URI.parse(url) + uri = URI.parse(url.strip) # resolve (protocol) relative URIs if uri.relative? - base_uri = URI.parse(base_url) + base_uri = URI.parse(base_url.strip) scheme = base_uri.scheme || "http" uri = URI.join("#{scheme}://#{base_uri.host}", uri) end