mirror of
https://github.com/Ylianst/MeshCentralRouter
synced 2025-12-18 09:13:17 +00:00
Better handle missing system proxy/credentials
This commit is contained in:
@@ -289,12 +289,11 @@ namespace MeshCentralRouter
|
|||||||
// Send proxy connection request
|
// Send proxy connection request
|
||||||
wsrawstream = wsclient.GetStream();
|
wsrawstream = wsclient.GetStream();
|
||||||
|
|
||||||
string userCreds = proxyUri.UserInfo;
|
|
||||||
string basicAuth = "";
|
string basicAuth = "";
|
||||||
if (userCreds.Length > 0)
|
if (proxyUri?.UserInfo != null)
|
||||||
{
|
{
|
||||||
// Base64 encode for basic authentication
|
// Base64 encode for basic authentication
|
||||||
userCreds = System.Convert.ToBase64String(Encoding.GetEncoding("ISO-8859-1").GetBytes(userCreds));
|
string userCreds = System.Convert.ToBase64String(Encoding.GetEncoding("ISO-8859-1").GetBytes(proxyUri.UserInfo));
|
||||||
basicAuth = "\r\nProxy-Authorization: Basic " + userCreds;
|
basicAuth = "\r\nProxy-Authorization: Basic " + userCreds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user