mirror of
https://github.com/2dust/v2rayN.git
synced 2026-10-29 08:35:00 +03:00
feat: support custom headers for Xray HTTP outbounds (#9690)
* feat: support custom headers for Xray HTTP outbounds * feat: simplify HTTP outbound headers input * feat: validate JSON syntax in HTTP headers Keep HTTP outbound headers stored as raw text, while validating header names and values against RFC 9110/9112 syntax. Support string arrays for multi-value headers, reject duplicate JSON header keys, and clarify the invalid header JSON message. * feat: refactor HTTP header parsing into utility * Simplify code * Simplify code * Update CoreConfigV2rayServiceTests.cs --------- Co-authored-by: 2dust <31833384+2dust@users.noreply.github.com>
This commit is contained in:
@@ -130,6 +130,25 @@ internal static class CoreConfigTestFactory
|
||||
};
|
||||
}
|
||||
|
||||
public static ProfileItem CreateHttpNode(ECoreType coreType, string indexId = "node-http-1",
|
||||
string remarks = "demo-http")
|
||||
{
|
||||
return new ProfileItem
|
||||
{
|
||||
IndexId = indexId,
|
||||
ConfigType = EConfigType.HTTP,
|
||||
CoreType = coreType,
|
||||
Remarks = remarks,
|
||||
Address = "proxy.example.com",
|
||||
Port = 8080,
|
||||
Password = "pass",
|
||||
Username = "user",
|
||||
Network = nameof(ETransport.raw),
|
||||
StreamSecurity = string.Empty,
|
||||
Subid = string.Empty,
|
||||
};
|
||||
}
|
||||
|
||||
public static ProfileItem CreatePolicyGroupNode(ECoreType coreType, string indexId, string remarks,
|
||||
IEnumerable<string> childIndexIds)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user