Skip to content

Commit dd02aac

Browse files
markekrausiSazonov
authored andcommitted
[feature] Fix TestValue to avoid double // in Urls (PowerShell#4920)
•Adds logic in Get-WebListenerUrl to only apply the TestValue part of the path if it was supplied.
1 parent efbdea5 commit dd02aac

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

test/tools/Modules/WebListener/WebListener.psm1

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,16 @@ function Get-WebListenerUrl {
141141
$Uri.Port = $runningListener.HttpsPort
142142
$Uri.Scheme = 'Https'
143143
}
144-
$Uri.Path = '{0}/{1}' -f $Test, $TestValue
144+
145+
if ($TestValue)
146+
{
147+
$Uri.Path = '{0}/{1}' -f $Test, $TestValue
148+
}
149+
else
150+
{
151+
$Uri.Path = $Test
152+
}
153+
145154
return [Uri]$Uri.ToString()
146155
}
147156
}

0 commit comments

Comments
 (0)