lib/vagrant/action/builtin/box_add.rb in vagrant-unbundled-1.9.5.1 vs lib/vagrant/action/builtin/box_add.rb in vagrant-unbundled-1.9.7.1

- old
+ new

@@ -28,9 +28,19 @@ end def call(env) @download_interrupted = false + unless env[:box_name].nil? + begin + if URI.parse(env[:box_name]).kind_of?(URI::HTTP) + env[:ui].warn(I18n.t("vagrant.box_add_url_warn")) + end + rescue URI::InvalidURIError + # do nothing + end + end + url = Array(env[:box_url]).map do |u| u = u.gsub("\\", "/") if Util::Platform.windows? && u =~ /^[a-z]:/i # On Windows, we need to be careful about drive letters u = "file:///#{URI.escape(u)}"