From 91637590eae6a54813b4917945d055dabcd0a681 Mon Sep 17 00:00:00 2001 From: Tom Bell Date: Mon, 10 Dec 2018 17:38:19 +0000 Subject: [PATCH] URL Decode proxy usernames and passwords. --- Microsoft.Alm.Authentication/Src/Network.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Microsoft.Alm.Authentication/Src/Network.cs b/Microsoft.Alm.Authentication/Src/Network.cs index cd7fd21..da4efe7 100644 --- a/Microsoft.Alm.Authentication/Src/Network.cs +++ b/Microsoft.Alm.Authentication/Src/Network.cs @@ -623,8 +623,10 @@ namespace Microsoft.Alm.Authentication if (hasUserNameAndPassword) { - string userName = proxyUri.UserInfo.Substring(0, tokenIndex); - string password = proxyUri.UserInfo.Substring(tokenIndex + 1); + //Usernames and passwords in git config for proxies are expected to be Url encoded + //so decode them. + string userName = WebUtility.UrlDecode(proxyUri.UserInfo.Substring(0, tokenIndex)); + string password = WebUtility.UrlDecode(proxyUri.UserInfo.Substring(tokenIndex + 1)); var proxyCreds = new NetworkCredential(userName, password);