1
0
mirror of https://github.com/Ylianst/MeshCentralRouter synced 2025-12-06 00:13:33 +00:00

Added support for mapping name in URL.

This commit is contained in:
Ylian Saint-Hilaire
2022-05-16 16:51:16 -07:00
parent f6c44b1d42
commit 40f8a7e663

View File

@@ -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<string, object> map = new Dictionary<string, object>();
if (autoName != null) { map.Add("name", HttpUtility.UrlDecode(autoName)); }
map.Add("nodeId", autoNodeId);
if (autoRemoteIp != null) { map.Add("remoteIP", autoRemoteIp); }
map.Add("remotePort", autoRemotePort);