From 4d57656c5ba0e20b245771c18ce82ef2ca19c938 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Mon, 8 Jun 2020 18:44:53 -0700 Subject: [PATCH] Fixed URL exception when creating a port map. --- MainForm.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/MainForm.cs b/MainForm.cs index b477bed..d0e9dad 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -668,7 +668,7 @@ namespace MeshCentralRouter map.remotePort = (int)remotePort; map.appId = appId; map.node = node; - map.host = serverNameComboBox.Text; + if (authLoginUrl != null) { map.host = authLoginUrl.Host + ":" + ((authLoginUrl.Port > 0) ? authLoginUrl.Port : 443); } else { map.host = serverNameComboBox.Text; } map.authCookie = meshcentral.authCookie; map.certhash = meshcentral.wshash; map.parent = this; @@ -730,7 +730,7 @@ namespace MeshCentralRouter map.remotePort = (int)remotePort; map.appId = appId; map.node = node; - map.host = serverNameComboBox.Text; + if (authLoginUrl != null) { map.host = authLoginUrl.Host + ":" + ((authLoginUrl.Port > 0) ? authLoginUrl.Port : 443); } else { map.host = serverNameComboBox.Text; } map.authCookie = meshcentral.authCookie; map.certhash = meshcentral.wshash; map.parent = this; @@ -759,7 +759,7 @@ namespace MeshCentralRouter map.remotePort = form.getRemotePort(); map.appId = form.getAppId(); map.node = form.getNode(); - map.host = serverNameComboBox.Text; + if (authLoginUrl != null) { map.host = authLoginUrl.Host + ":" + ((authLoginUrl.Port > 0) ? authLoginUrl.Port : 443); } else { map.host = serverNameComboBox.Text; } map.authCookie = meshcentral.authCookie; map.certhash = meshcentral.wshash; map.parent = this; @@ -877,7 +877,7 @@ namespace MeshCentralRouter map.remoteIP = form.getRemoteIP(); map.appId = form.getAppId(); map.node = form.getNode(); - map.host = serverNameComboBox.Text; + if (authLoginUrl != null) { map.host = authLoginUrl.Host + ":" + ((authLoginUrl.Port > 0) ? authLoginUrl.Port : 443); } else { map.host = serverNameComboBox.Text; } map.authCookie = meshcentral.authCookie; map.certhash = meshcentral.wshash; map.parent = this; @@ -1014,7 +1014,7 @@ namespace MeshCentralRouter map.remotePort = port; // HTTP map.appId = appId; // 0 = Custom, 1 = HTTP, 2 = HTTPS, 3 = RDP, 4 = PuTTY, 5 = WinSCP map.node = node; - map.host = serverNameComboBox.Text; + if (authLoginUrl != null) { map.host = authLoginUrl.Host + ":" + ((authLoginUrl.Port > 0) ? authLoginUrl.Port : 443); } else { map.host = serverNameComboBox.Text; } map.authCookie = meshcentral.authCookie; map.certhash = meshcentral.wshash; map.parent = this;