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: idna::domain_to_ascii folds regex escapes in a Tree hostname, inverting \D into \d #1377
add_tree_rule folds the whole hostname through idna::domain_to_ascii, including the regex source
of a Tree-position frontend. For an uppercase regex escape this inverts the character class: \D becomes \d, \W becomes \w, \S becomes \s.
A frontend written /[^\D]/.example.com therefore routes the complement of what the operator wrote,
silently.
And the meanings are opposites: [^\D] matches '7' and not 'a'; [^\d] matches 'a' and not '7'.
Impact
Silent and invisible from configuration: the frontend loads, sozu query frontends shows exactly what
the operator typed, and the rule matches the wrong set of hosts. Affects Tree position only — Pre/Post keep the regex source verbatim.
Uppercase escapes are not exotic; \D, \W, \S and \B are ordinary regex vocabulary.
Suggested direction
Case-fold only the literal labels, not the regex segments — the same split convert_regex_domain_rule already makes between literal labels and /…/ segments. Whether the
hostname should be IDN-normalised at all once it contains a regex segment is the design question; a
regex segment is not a domain label and arguably should not go through domain_to_ascii.
Provenance
Found while fixing #1349 (host-case normalization), where the same folding is the reason a Tree
frontend cannot carry case-significant regex syntax. Deliberately scoped out of that change and left
untouched; it wants its own red-then-green.
Activity
fix(router): keep a Tree hostname's regex source out of IDNA folding
test(router): quickcheck property harness for hostname resolution
test(router): quickcheck property harness for hostname resolution (#1407