You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
router: $HOST[n] captures are numbered right-to-left for tree rules but left-to-right for pre/post rules #1595
Found while working on #1594. Nothing in the code has changed yet; this issue only records the inconsistency.
A tree-shaped host rule numbers the $HOST[n] captures of its regex segments right to left (in reverse domain order, the order the pattern trie walks). A pre/post (prefix/suffix) host rule numbers them left to right.
The same hostname shape therefore produces different $HOST[n] values depending on how the rule was compiled. Any rewrite template that uses $HOST[n] may pick a different label than its author expected.
a_host_capture_past_sixteen_trie_segments_keeps_every_segment, added in #1594, pins the current tree order so that the allocation change does not alter it.
To decide
Which order is the documented contract? Check doc/ for $HOST[.
Should the tree path reverse its captures to match? That changes behaviour for existing tree rules, so it needs a CHANGELOG entry and a migration note.
Activity
fix(router): number tree-rule $HOST[n] captures left to right (#1617)