fix: restrict xhttp browser dialer mode and remove added tests

Agent-Logs-Url: https://github.com/XTLS/Xray-core/sessions/071df77b-69fb-4b1f-a14d-9dab447e1efa

Co-authored-by: RPRX <63339210+RPRX@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-04-26 17:16:42 +00:00
committed by GitHub
parent a54c54a559
commit 5906445c68
2 changed files with 17 additions and 63 deletions
+16
View File
@@ -1980,6 +1980,22 @@ func (c *StreamConfig) Build() (*internet.StreamConfig, error) {
if strings.EqualFold(c.Security, "reality") {
return nil, errors.New("sockopt.browserDialer does not support REALITY")
}
if config.ProtocolName == "splithttp" {
splitHTTPSettings := c.SplitHTTPSettings
if c.XHTTPSettings != nil {
splitHTTPSettings = c.XHTTPSettings
}
if splitHTTPSettings != nil {
splitHTTPSettingsCopy := *splitHTTPSettings
hs, err := splitHTTPSettingsCopy.Build()
if err != nil {
return nil, errors.New("Failed to build XHTTP config.").Base(err)
}
if splitHTTPConfig, ok := hs.(*splithttp.Config); ok && splitHTTPConfig.Mode != "auto" && splitHTTPConfig.Mode != "packet-up" {
return nil, errors.New("sockopt.browserDialer only supports XHTTP mode auto or packet-up")
}
}
}
}
switch strings.ToLower(c.Security) {