mirror of
https://github.com/2dust/v2rayN.git
synced 2025-11-29 03:02:53 +00:00
Format imported xhttp extra (#8390)
This commit is contained in:
parent
9ffa6a4eb6
commit
23cacb8339
1 changed files with 23 additions and 16 deletions
|
|
@ -118,22 +118,15 @@ public class BaseFmt
|
|||
}
|
||||
if (item.Extra.IsNotEmpty())
|
||||
{
|
||||
var extra = item.Extra;
|
||||
try
|
||||
{
|
||||
var node = JsonNode.Parse(item.Extra);
|
||||
if (node != null)
|
||||
{
|
||||
extra = node.ToJsonString(new JsonSerializerOptions
|
||||
var node = JsonUtils.ParseJson(item.Extra);
|
||||
var extra = node != null
|
||||
? JsonUtils.Serialize(node, new JsonSerializerOptions
|
||||
{
|
||||
WriteIndented = false,
|
||||
DefaultIgnoreCondition = JsonIgnoreCondition.Never,
|
||||
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping
|
||||
});
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
})
|
||||
: item.Extra;
|
||||
dicQuery.Add("extra", Utils.UrlEncode(extra));
|
||||
}
|
||||
break;
|
||||
|
|
@ -253,7 +246,21 @@ public class BaseFmt
|
|||
item.RequestHost = GetQueryDecoded(query, "host");
|
||||
item.Path = GetQueryDecoded(query, "path", "/");
|
||||
item.HeaderType = GetQueryDecoded(query, "mode");
|
||||
item.Extra = GetQueryDecoded(query, "extra");
|
||||
var extraDecoded = GetQueryDecoded(query, "extra");
|
||||
if (extraDecoded.IsNotEmpty())
|
||||
{
|
||||
var node = JsonUtils.ParseJson(extraDecoded);
|
||||
if (node != null)
|
||||
{
|
||||
extraDecoded = JsonUtils.Serialize(node, new JsonSerializerOptions
|
||||
{
|
||||
WriteIndented = true,
|
||||
DefaultIgnoreCondition = JsonIgnoreCondition.Never,
|
||||
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping
|
||||
});
|
||||
}
|
||||
}
|
||||
item.Extra = extraDecoded;
|
||||
break;
|
||||
|
||||
case nameof(ETransport.http):
|
||||
|
|
|
|||
Loading…
Reference in a new issue