From 6ea88b9141f6558a4a341b39a87a4ea30cfe239b Mon Sep 17 00:00:00 2001 From: DHR60 Date: Tue, 25 Nov 2025 11:35:40 +0800 Subject: [PATCH] Remove formatted spaces from extra JSON before URL encoding --- v2rayN/ServiceLib/Handler/Fmt/BaseFmt.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/v2rayN/ServiceLib/Handler/Fmt/BaseFmt.cs b/v2rayN/ServiceLib/Handler/Fmt/BaseFmt.cs index 2f31e827..ffcd15c5 100644 --- a/v2rayN/ServiceLib/Handler/Fmt/BaseFmt.cs +++ b/v2rayN/ServiceLib/Handler/Fmt/BaseFmt.cs @@ -118,7 +118,23 @@ public class BaseFmt } if (item.Extra.IsNotEmpty()) { - dicQuery.Add("extra", Utils.UrlEncode(item.Extra)); + var extra = item.Extra; + try + { + var node = JsonNode.Parse(item.Extra); + if (node != null) + { + extra = node.ToJsonString(new JsonSerializerOptions + { + WriteIndented = false, + Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping + }); + } + } + catch + { + } + dicQuery.Add("extra", Utils.UrlEncode(extra)); } break;