Finalmask check (#9024)

This commit is contained in:
DHR60
2026-03-31 11:33:25 +00:00
committed by GitHub
parent 70003e8a81
commit fce86e1434
@@ -143,11 +143,19 @@ public class NodeValidator
if (item.Network == nameof(ETransport.xhttp) && !item.Extra.IsNullOrEmpty()) if (item.Network == nameof(ETransport.xhttp) && !item.Extra.IsNullOrEmpty())
{ {
if (JsonUtils.ParseJson(item.Extra) is null) if (JsonUtils.ParseJson(item.Extra) is not JsonObject)
{ {
v.Error(string.Format(ResUI.MsgInvalidProperty, "XHTTP Extra")); v.Error(string.Format(ResUI.MsgInvalidProperty, "XHTTP Extra"));
} }
} }
if (!item.Finalmask.IsNullOrEmpty())
{
if (JsonUtils.ParseJson(item.Finalmask) is not JsonObject)
{
v.Error(string.Format(ResUI.MsgInvalidProperty, "Finalmask"));
}
}
} }
private static string? ValidateSingboxTransport(EConfigType configType, string net) private static string? ValidateSingboxTransport(EConfigType configType, string net)