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:
006lp
2026-07-11 14:31:17 +08:00
committed by GitHub
parent 2c70b018ce
commit 88d59488fd
14 changed files with 225 additions and 6 deletions
@@ -256,6 +256,27 @@
Grid.Column="1"
Width="400"
Margin="{StaticResource Margin4}" />
<TextBlock
x:Name="tbHttpHeaders"
Grid.Row="3"
Grid.Column="0"
Margin="{StaticResource Margin4}"
VerticalAlignment="Center"
IsVisible="False"
Text="{x:Static resx:ResUI.TbHttpOutboundHeaders}"
ToolTip.Tip="{x:Static resx:ResUI.TipHttpOutboundHeaders}" />
<views:JsonEditor
x:Name="txtHttpHeadersJson"
Grid.Row="3"
Grid.Column="1"
Width="400"
MinHeight="100"
Margin="{StaticResource Margin4}"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
IsVisible="False"
ToolTip.Tip="{x:Static resx:ResUI.TipHttpOutboundHeaders}" />
</Grid>
<Grid
x:Name="gridVLESS"