Ensure usernames with at symbols handled (#1558)

Domain usernames may use '@' as part of the username, which requires
encoding to be able to be used within an URI.
This commit is contained in:
Darragh Bailey
2022-08-24 18:16:14 +01:00
committed by GitHub
parent 1945754f67
commit 8673fa2791
2 changed files with 8 additions and 1 deletions

View File

@@ -782,7 +782,7 @@ module VagrantPlugins
finalize_id_ssh_key_file
uri += '+ssh://'
uri += "#{@username}@" if @username && @username != UNSET_VALUE
uri += "#{URI.encode_www_form_component(@username)}@" if @username && @username != UNSET_VALUE
uri += (@host && @host != UNSET_VALUE ? @host : 'localhost')