Fix fragment exports for older Xray clients (#6702)

* Fix fragment exports for older Xray clients

* fix(link): tolerate a finalmask without tcp in panel share links

withLegacyFragmentRanges called finalmask.tcp.map unguarded, but stored
rows reach the link generator unparsed and dropEmptyFinalMask deletes an
empty tcp list on save. Any VMess/VLESS/Trojan/SS inbound with only UDP
masks or quicParams threw a TypeError in the QR, info and export-links
views. The Go counterpart already skipped a missing tcp.

Also trims the Go helper's comment to the two-line cap and drops a
[]string branch no JSON-decoded finalmask can reach.

---------

Co-authored-by: Artem K <a.kush@vkteam.ru>
Co-authored-by: Sanaei <ho3ein.sanaei@gmail.com>
This commit is contained in:
Artem K
2026-10-02 18:38:44 +03:00
committed by GitHub
parent a716122ef2
commit 721de5adde
6 changed files with 413 additions and 7 deletions
+3
View File
@@ -636,6 +636,9 @@ func (s *SubJsonService) getConfig(subReq *SubService, inbound *model.Inbound, c
applyExternalProxyTLSToStream(extPrxy, newStream, security)
}
applyHostStreamOverrides(extPrxy, newStream)
if finalmask, ok := newStream["finalmask"].(map[string]any); ok {
newStream["finalmask"] = withLegacyFragmentRanges(finalmask)
}
streamSettings, _ := json.MarshalIndent(newStream, "", " ")
hostMux := hostMuxOverride(extPrxy)