Set empty host when nil on finalize_from_uri

With ruby3.2, URI.parse now sets empty host instead of nil via:
dd5118f852

Adjust test case so, also with ruby <= 3.1, forcely set empty string for host
when nil to make finalize_from_uri behavior consistent between different
host ruby versions.
This commit is contained in:
Mamoru TASAKA
2023-01-19 17:07:39 +09:00
parent 517bf7792a
commit 578d3ae429
2 changed files with 4 additions and 4 deletions

View File

@@ -1304,8 +1304,8 @@ module VagrantPlugins
end
end
# Extract host values from uri if provided, otherwise nil
@host = uri.host
# Extract host values from uri if provided, otherwise set empty string
@host = uri.host || ""
@port = uri.port
# only override username if there is a value provided
@username = nil if @username == UNSET_VALUE