Escape/unescape cURL URLs/auth
so that we can deal with special characters in usernames and passwords
This commit is contained in:
parent
bdb945cd1b
commit
29c77e5719
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue