Remove formatted spaces from extra JSON before URL encoding (#8385)
Some checks are pending
release Linux / build (Release) (push) Waiting to run
release Linux / rpm (push) Blocked by required conditions
release macOS / build (Release) (push) Waiting to run
release Windows desktop (Avalonia UI) / build (Release) (push) Waiting to run
release Windows / build (Release) (push) Waiting to run

This commit is contained in:
DHR60 2025-11-25 17:40:41 +08:00 committed by GitHub
parent 386209b835
commit 9ffa6a4eb6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;