Skip to content

Fix #1494: WithClientIP(MatchOperator, params IStringMatcher[]) ignores the MatchOperator argument - #1495

Merged
StefH merged 1 commit into
wiremock:masterfrom
Bafyn:fix/clientip-matchoperator-ignored
Aug 9, 2026
Merged

Fix #1494: WithClientIP(MatchOperator, params IStringMatcher[]) ignores the MatchOperator argument#1495
StefH merged 1 commit into
wiremock:masterfrom
Bafyn:fix/clientip-matchoperator-ignored

Conversation

@Bafyn

@Bafyn Bafyn commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Problem

WithClientIP(MatchOperator matchOperator, params IStringMatcher[] matchers) ignored its matchOperator argument and always used MatchOperator.Or. Combining multiple client-IP matchers with And (or Average) had no effect - the request matched if any matcher matched, even when all were required.

Tests

Added Request_WithClientIP_MatchOperator_And_RequiresAllMatchers: with And, an IP that matches only one of two matchers is a mismatch (0.0), and one matching both is 1.0.

References

Fixes #1494

Submitter checklist

  • The PR request is well described and justified, including the body and the references
  • The PR title represents the desired changelog entry
  • The repository's code style is followed (see the contributing guide)
  • Test coverage that demonstrates that the change works as expected

@Bafyn Bafyn changed the title Fix #1494: WithClientIP(MatchOperator matchOperator, params IStringMatcher[] matchers) ignores the MatchOperator argument Fix #1494: WithClientIP(MatchOperator, params IStringMatcher[]) ignores the MatchOperator argument Aug 7, 2026
@StefH StefH added the bug Something isn't working label Aug 9, 2026
@StefH
StefH merged commit 7a8582f into wiremock:master Aug 9, 2026
6 checks passed
@Bafyn
Bafyn deleted the fix/clientip-matchoperator-ignored branch August 9, 2026 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WithClientIP(MatchOperator, params IStringMatcher[]) ignores the MatchOperator argument

2 participants