Remove formatted spaces from extra JSON before URL encoding

This commit is contained in:
DHR60 2025-11-25 11:35:40 +08:00
parent 386209b835
commit 6ea88b9141

View file

@ -118,7 +118,23 @@ public class BaseFmt
} }
if (item.Extra.IsNotEmpty()) 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; break;