mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-11-02 11:15:03 +03:00
fix(sub): bound what a remote routing profile renders to
Remote routing sources are fetched documents the panel re-renders on every subscription request. A Clash YAML document stays small through aliases, which decode to one shared value but are written out in full, so it now has to fit a 4 MiB written-size budget and 16 levels of nesting when it is accepted (and when a persisted copy is loaded). A JSON routing profile could repeat route groups, each copy repeating every site list; a group now counts once, since a repeat can never match.
This commit is contained in:
@@ -210,7 +210,10 @@ func buildJsonRoutingSpec(object map[string]any) (jsonRoutingSpec, error) {
|
||||
for _, segment := range strings.Split(order, "-") {
|
||||
switch segment {
|
||||
case "block", "proxy", "direct":
|
||||
spec.RouteOrder = append(spec.RouteOrder, segment)
|
||||
// A repeat can never match (the first rule wins) and would copy every list again.
|
||||
if !slices.Contains(spec.RouteOrder, segment) {
|
||||
spec.RouteOrder = append(spec.RouteOrder, segment)
|
||||
}
|
||||
}
|
||||
}
|
||||
return spec, nil
|
||||
|
||||
Reference in New Issue
Block a user