mirror of
https://github.com/haproxy/haproxy.git
synced 2026-05-21 01:15:17 -04:00
In domain-based routing and policy rules, suffix matching on hostnames is often easier to express as a prefix match on reversed labels. A dedicated converter makes this convenient with existing fetches and matchers. This also has a performance benefit for large maps. Prefix string matches use the prefix-tree index (PAT_MATCH_BEG with pat_idx_tree_pfx), while end matches use the string-list index (PAT_MATCH_END with pat_idx_list_str), so reversed-label lookups can avoid linear suffix scans. This patch adds "reverse_dom", a string converter that reverses domain labels, ignores one optional trailing dot on input, and rejects empty labels. It intentionally leaves trailing-dot handling to the caller so configurations can choose between exact matches, subdomain-only matches, or an explicit dotted form built with "concat(.)" for prefix lookups. Examples: example.com -> com.example mail.example.com -> com.example.mail The documentation is updated and a reg-test covers the converter itself, the explicit dotted form for "map_beg()", and the subdomain-only "-m beg" case. |
||
|---|---|---|
| .. | ||
| add_item.vtc | ||
| aes_cbc.vtc | ||
| aes_gcm.vtc | ||
| be2dec.vtc | ||
| be2hex.vtc | ||
| bytes.vtc | ||
| digest.vtc | ||
| field.vtc | ||
| fix.vtc | ||
| hmac.vtc | ||
| iif.vtc | ||
| json.vtc | ||
| json_query.vtc | ||
| le2dec.vtc | ||
| mqtt.vtc | ||
| param.vtc | ||
| reverse.vtc | ||
| reverse_dom.map | ||
| reverse_dom.vtc | ||
| secure_memcmp.vtc | ||
| sha2.vtc | ||
| url_dec.vtc | ||
| url_enc.vtc | ||
| word.vtc | ||