From dd02aac3d718e79ca1e1924ab991e34cdbb76750 Mon Sep 17 00:00:00 2001 From: Mark Kraus Date: Tue, 26 Sep 2017 00:05:55 -0500 Subject: [PATCH] [feature] Fix TestValue to avoid double // in Urls (#4920) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit •Adds logic in Get-WebListenerUrl to only apply the TestValue part of the path if it was supplied. --- test/tools/Modules/WebListener/WebListener.psm1 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/test/tools/Modules/WebListener/WebListener.psm1 b/test/tools/Modules/WebListener/WebListener.psm1 index 6fe0049cde..87a5899d30 100644 --- a/test/tools/Modules/WebListener/WebListener.psm1 +++ b/test/tools/Modules/WebListener/WebListener.psm1 @@ -141,7 +141,16 @@ function Get-WebListenerUrl { $Uri.Port = $runningListener.HttpsPort $Uri.Scheme = 'Https' } - $Uri.Path = '{0}/{1}' -f $Test, $TestValue + + if ($TestValue) + { + $Uri.Path = '{0}/{1}' -f $Test, $TestValue + } + else + { + $Uri.Path = $Test + } + return [Uri]$Uri.ToString() } }