mirror of
https://github.com/go-gost/x.git
synced 2026-10-19 16:16:32 +00:00
filterToMatcherRule produced `Host(x) || Host(.x) && Proto(...) && ...`, but the matcher DSL (vulcand/predicate) binds && tighter than ||, so the apex Host(x) branch bypassed the protocol/path conjuncts — a request to the apex with a non-matching protocol/path matched where the legacy filter (AND of host/protocol/path) rejected it. Also normalize `*.example.com` to `.example.com` before the leading-dot branch: legacy ParseNode did this so both forms matched apex+subdomains; without it, `*.example.com` reached Host() as a wildcard matching only subdomains, dropping apex coverage that `.example.com` still had. - Parenthesize the host OR when protocol/path conjuncts follow. - Strip leading `*` + ensure leading dot, mirroring legacy normalization. - Update TestFilterToMatcherRule expectations; add dot/star combined cases. - Add TestFilterToMatcherRule_Precedence: runtime guard that apex+wrong proto/path is rejected and apex/subdomain+valid is accepted, for both `.example.com` and `*.example.com` forms.