mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-09-04 17:37:19 +00:00
fix(link): parse the snake_case and extra-blob xhttp fields when importing a share link
The panel's share-link emitters (Go and TS) carry advanced xhttp knobs as a snake_case x_padding_bytes plus an extra=<json> payload, but the Go parser's xhttp branch read only top-level camelCase params, so importing an xhttp link via the outbound-subscription feature dropped xPaddingBytes, scMaxEachPostBytes and the rest, silently reverting them to the stream defaults and producing a non-working outbound. Mirror the TS parser: read the snake_case alias, merge the extra JSON blob, then let explicit camelCase params win.
This commit is contained in:
@@ -622,7 +622,22 @@ func applyTransport(stream map[string]any, p url.Values) {
|
||||
if m := p.Get("mode"); m != "" {
|
||||
xh["mode"] = m
|
||||
}
|
||||
// A few advanced xhttp fields that are commonly carried
|
||||
// The panel's own emitters carry the advanced xhttp knobs as a
|
||||
// snake_case x_padding_bytes plus an extra=<json> blob, not as top-level
|
||||
// camelCase params. Mirror the TS parser's precedence (snake_case alias
|
||||
// -> extra JSON -> explicit camelCase) so a re-imported share link keeps
|
||||
// them instead of silently reverting to the stream defaults.
|
||||
if v := p.Get("x_padding_bytes"); v != "" {
|
||||
xh["xPaddingBytes"] = v
|
||||
}
|
||||
if extra := p.Get("extra"); extra != "" {
|
||||
var parsed map[string]any
|
||||
if err := json.Unmarshal([]byte(extra), &parsed); err == nil {
|
||||
for k, v := range parsed {
|
||||
xh[k] = v
|
||||
}
|
||||
}
|
||||
}
|
||||
for _, k := range []string{"xPaddingBytes", "scMaxEachPostBytes", "scMinPostsIntervalMs", "uplinkChunkSize"} {
|
||||
if v := p.Get(k); v != "" {
|
||||
xh[k] = v
|
||||
|
||||
Reference in New Issue
Block a user