From 40f8a7e663076091c3f4bdc2dec62bcd7eddefd7 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Mon, 16 May 2022 16:51:16 -0700 Subject: [PATCH] Added support for mapping name in URL. --- MainForm.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/MainForm.cs b/MainForm.cs index 3c7d9d0..f8da223 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -29,6 +29,7 @@ using System.Security.Cryptography.X509Certificates; using Microsoft.Win32; using System.Drawing; using System.Text; +using System.Web; namespace MeshCentralRouter { @@ -268,6 +269,7 @@ namespace MeshCentralRouter // Set automatic port map values if (authLoginUrl != null) { + string autoName = null; string autoNodeId = null; string autoRemoteIp = null; int autoRemotePort = 0; @@ -279,6 +281,7 @@ namespace MeshCentralRouter try { // Automatic mappings + autoName = getValueFromQueryString(authLoginUrl.Query, "name"); autoNodeId = getValueFromQueryString(authLoginUrl.Query, "nodeid"); autoRemoteIp = getValueFromQueryString(authLoginUrl.Query, "remoteip"); int.TryParse(getValueFromQueryString(authLoginUrl.Query, "remoteport"), out autoRemotePort); @@ -293,6 +296,7 @@ namespace MeshCentralRouter if (((autoRemotePort != 0) && (autoProtocol != 0) && (autoNodeId != null)) || ((autoNodeId != null) && ((autoAppId == 6) || (autoAppId == 7)))) { Dictionary map = new Dictionary(); + if (autoName != null) { map.Add("name", HttpUtility.UrlDecode(autoName)); } map.Add("nodeId", autoNodeId); if (autoRemoteIp != null) { map.Add("remoteIP", autoRemoteIp); } map.Add("remotePort", autoRemotePort);