mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 04:50:33 +01:00
RequestMessageHeaderMatcher with MatchBehaviour.RejectOnMatch reverses match results twice #444
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @flts on GitHub (Aug 22, 2022).
Describe the bug
Following the Reversing the match behaviour with MatchBehaviour.RejectOnMatch
example the reponse will always be
Unauthorizedeven if a correct header is added on the request.I believe the following line shouldn't call
MatchBehaviourHelper.Convert()again as it is already called for each Matcher. Other RequestMessage***Matcher's do not callMatchBehaviourHelper.Convert()before returning.be4b0addca/src/WireMock.Net/Matchers/Request/RequestMessageHeaderMatcher.cs (L138)Expected behavior:
Given the following example taken from the docs. The expected behavior is that only an
Unauthorizedresponse is returned when the headerapi-keyis missing from the http request.Other related info
Since WireMock.Net v1.5.0.