checking whether the field location_uri.host is nil
This commit is contained in:
parent
1f99da7a11
commit
2613d620fd
|
@ -107,8 +107,10 @@ module Vagrant
|
|||
if progress_data.include?("Location")
|
||||
location = progress_data.scan(/Location: (.+?)$/m).flatten.compact.first.to_s.strip
|
||||
if !location.empty?
|
||||
@logger.info("download redirected to #{location}")
|
||||
location_uri = URI.parse(location)
|
||||
|
||||
unless location_uri.host.nil?
|
||||
@logger.info("download redirected to #{location}")
|
||||
source_uri = URI.parse(source)
|
||||
source_host = source_uri.host.split(".", 2).last
|
||||
location_host = location_uri.host.split(".", 2).last
|
||||
|
@ -118,6 +120,7 @@ module Vagrant
|
|||
end
|
||||
@redirect_notify = true
|
||||
end
|
||||
end
|
||||
progress_data.replace("")
|
||||
break
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue