From 17f88abcb2a681ba6655d981713ec93760d8a702 Mon Sep 17 00:00:00 2001 From: ChsBuffer <33744752+chsbuffer@users.noreply.github.com> Date: Sat, 20 Feb 2021 19:00:42 +0800 Subject: [PATCH] Update VShareLink Utils --- Netch/Servers/V2ray/V2rayUtils.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Netch/Servers/V2ray/V2rayUtils.cs b/Netch/Servers/V2ray/V2rayUtils.cs index b8ca6c6ee1..b00dc75f68 100644 --- a/Netch/Servers/V2ray/V2rayUtils.cs +++ b/Netch/Servers/V2ray/V2rayUtils.cs @@ -38,7 +38,7 @@ public static IEnumerable ParseVUri(string text) break; case "ws": server.Path = Uri.UnescapeDataString(parameter.Get("path") ?? "/"); - server.Host = parameter.Get("host") ?? ""; + server.Host = Uri.UnescapeDataString(parameter.Get("host") ?? ""); break; case "h2": server.Path = Uri.UnescapeDataString(parameter.Get("path") ?? "/"); @@ -83,6 +83,7 @@ public static IEnumerable ParseVUri(string text) public static string GetVShareLink(Server s, string scheme = "vmess") { + // https://github.com/XTLS/Xray-core/issues/91 var server = (VMess.VMess) s; var parameter = new Dictionary(); // protocol-specific fields @@ -107,7 +108,7 @@ public static string GetVShareLink(Server s, string scheme = "vmess") case "ws": parameter.Add("path", Uri.EscapeDataString(server.Path.IsNullOrWhiteSpace() ? "/" : server.Path)); if (!server.Host.IsNullOrWhiteSpace()) - parameter.Add("host", server.Host); + parameter.Add("host", Uri.EscapeDataString(server.Host)); break; case "h2":