From 29c77e571973e332a69a48f81960ffe2ce34eeb5 Mon Sep 17 00:00:00 2001 From: Matthew Rahtz Date: Wed, 29 Apr 2015 14:32:24 +0100 Subject: [PATCH] Escape/unescape cURL URLs/auth so that we can deal with special characters in usernames and passwords --- lib/vagrant/util/downloader.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/vagrant/util/downloader.rb b/lib/vagrant/util/downloader.rb index dd3abaa72..5e52eb674 100644 --- a/lib/vagrant/util/downloader.rb +++ b/lib/vagrant/util/downloader.rb @@ -27,10 +27,10 @@ module Vagrant @destination = destination.to_s begin - url = URI.parse(@source) + url = URI.parse(URI.escape(@source)) if url.scheme && url.scheme.start_with?("http") && url.user - auth = "#{url.user}" - auth += ":#{url.password}" if url.password + auth = "#{URI.unescape(url.user)}" + auth += ":#{URI.unescape(url.password)}" if url.password url.user = nil url.password = nil options[:auth] ||= auth