Escape/unescape cURL URLs/auth

so that we can deal with special characters in usernames and passwords
This commit is contained in:
Matthew Rahtz 2015-04-29 14:32:24 +01:00
parent bdb945cd1b
commit 29c77e5719
1 changed files with 3 additions and 3 deletions

View File

@ -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