mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-11-19 03:25:01 +03:00
fix(sub): re-add xhttp mode to extra JSON for Karing (#5446)
Regression of #4364. Karing parses the `extra` JSON and ignores the flat `mode=` param, so when extra was present without `mode` it stored the transport with no mode and the handshake failed. The `mode` field that #4365 added to buildXhttpExtra was dropped during the share-link refactor; restore it in both the backend and frontend generators.
This commit is contained in:
@@ -369,8 +369,10 @@ func TestBuildXhttpExtra_IncludesClientSideFieldsWhenPresent(t *testing.T) {
|
||||
t.Fatalf("extra missing %q: %#v", key, extra)
|
||||
}
|
||||
}
|
||||
if _, ok := extra["mode"]; ok {
|
||||
t.Fatalf("mode should stay as a top-level query parameter, got extra %#v", extra)
|
||||
// mode rides inside extra (in addition to the flat param) so clients
|
||||
// that only read the extra JSON keep the xhttp mode (#5446).
|
||||
if extra["mode"] != "packet-up" {
|
||||
t.Fatalf("extra[mode] = %#v, want packet-up", extra["mode"])
|
||||
}
|
||||
|
||||
headers, ok := extra["headers"].(map[string]any)
|
||||
|
||||
Reference in New Issue
Block a user