Repository navigation
fix(matcher): align domain matching for ASCII case - #61
Merged
Merged
Conversation
Signed-off-by: ztywto <ztywto@qq.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
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
647ef409a302eb234b80715edfa2557702705835with 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 reportexpected: 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 countexpected: 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 actionexpected: 0x1,actual: 0x0.Candidate:
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 -lon 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.