FIX: We can download protocol relative urls

This commit is contained in:
Robin Ward 2017-05-15 15:32:55 -04:00
parent f7c46df804
commit 31f27006e1

View File

@ -7,6 +7,7 @@ class FileHelper
end
def self.download(url, max_file_size, tmp_file_name, follow_redirect=false, read_timeout=5)
url = "https:" + url if url.start_with?("//")
raise Discourse::InvalidParameters.new(:url) unless url =~ /^https?:\/\//
uri = parse_url(url)