Skip to content

fix(matcher): align domain matching for ASCII case - #61

Merged
johnlanni merged 1 commit into
mainfrom
fix/domain-match-ascii-case
Nov 17, 2026
Merged

johnlanni merged 1 commit into
mainfrom
fix/domain-match-ascii-case

Conversation

@johnlanni

Copy link
Copy Markdown
Contributor

What changed

  • Exact, Prefix, and Suffix domain rules now compare ASCII letters case-insensitively without allocation.
  • Added regression coverage for matcher behavior, plugin callback selection, and request-block local 403 responses.

Why

Byte-exact matching caused a configured domain rule not to be selected when the request authority differed only by ASCII case.

Compatibility

Only ASCII case behavior changes. Port stripping, trailing dots, IDNA conversion, IP normalization, wildcard classification, rule order, global fallback, and _match_service_ behavior are unchanged. No public API or configuration changes.

Release note: Domain rules now match request authorities consistently across ASCII letter case.

Tests

Parent 647ef409a302eb234b80715edfa2557702705835 with the new tests:

  • GOMAXPROCS=1 /usr/local/go/bin/go test -p 1 -parallel 1 -mod=readonly ./pkg/matcher -run '^TestHostMatchASCIICase$' -count=1 — exit 1; case variants report expected: true, actual: false.
  • GOMAXPROCS=1 /usr/local/go/bin/go test -p 1 -parallel 1 -mod=readonly ./pkg/wrapper -run '^TestDomainMatchASCIICaseInvokesHandler$' -count=1 — exit 1; case variants report callback count expected: 1, actual: 0.
  • cd examples/request-block && GOMAXPROCS=1 /usr/local/go/bin/go test -p 1 -parallel 1 -mod=readonly . -run '^TestDomainMatchASCIICaseBlocksRequest$/go' -count=1 — exit 1; case variants report action expected: 0x1, actual: 0x0.

Candidate:

  • The same three focused commands pass with exit 0.
  • GOMAXPROCS=1 /usr/local/go/bin/go test -p 1 -parallel 1 -mod=readonly ./pkg/... -count=1 — pass.
  • GOMAXPROCS=1 /usr/local/go/bin/go vet -mod=readonly ./pkg/... — pass.
  • /usr/local/go/bin/gofmt -l on changed files — no output.
  • cd examples/request-block && GOMAXPROCS=1 GOOS=wasip1 GOARCH=wasm /usr/local/go/bin/go build -p 1 -mod=readonly . — pass.

Real Envoy/Wasm integration was not run.

Signed-off-by: ztywto <ztywto@qq.com>
@johnlanni
johnlanni merged commit b4b1cef into main Nov 17, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant