From 5b2b493a908cbea55096f7f028c306f6270e3b00 Mon Sep 17 00:00:00 2001 From: "Renato \"Lond\" Cerqueira" Date: Wed, 29 Aug 2018 21:13:49 +0200 Subject: Fix nil host in remotable (#8508) Host can be nil in urls like 'https:https://example.com/path/file.png' --- app/models/concerns/remotable.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/models/concerns') diff --git a/app/models/concerns/remotable.rb b/app/models/concerns/remotable.rb index c17f19a60..9372a963b 100644 --- a/app/models/concerns/remotable.rb +++ b/app/models/concerns/remotable.rb @@ -18,7 +18,7 @@ module Remotable return end - return if !%w(http https).include?(parsed_url.scheme) || parsed_url.host.empty? || self[attribute_name] == url + return if !%w(http https).include?(parsed_url.scheme) || parsed_url.host.blank? || self[attribute_name] == url begin Request.new(:get, url).perform do |response| -- cgit