mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 22:30:41 +01:00
How to determine non-existent field(s) in cookies and headers? #247
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 @qq362220083 on GitHub (Feb 10, 2020).
I want to judge non-existent fields in cookie (header, param), such as "Authentication".
I found mapping files cannot implement this logic.
How to solve this problem?
thanks!
@qq362220083 commented on GitHub (Feb 10, 2020):
I tried to solve this problem by creating property on the cookie model (header & param model) object, but I found that the change exceeded my expectations, so I hope the author can help me!
@StefH commented on GitHub (Feb 10, 2020):
What do you mean by judge ?
Do you want to match a mapping when a cookie is absent?
@qq362220083 commented on GitHub (Feb 10, 2020):
Yes, you're right!
i want to match a mapping when a cookie(header or param) is absent.
@StefH commented on GitHub (Feb 11, 2020):
Take a look at :
https://github.com/WireMock-Net/WireMock.Net/wiki/Request-Matching#reversing-the-match-behaviour-with-matchbehaviourrejectonmatch
@qq362220083 commented on GitHub (Feb 11, 2020):
thanks. I have seen it, but I want to use mapping files to solve it.
@StefH commented on GitHub (Feb 11, 2020):
This is possible using mappings. See the updated WIKI page.
@qq362220083 commented on GitHub (Feb 11, 2020):
Sorry, I tested it according to the wiki and found that it still doesn't work.
take a look at:
https://github.com/WireMock-Net/WireMock.Net/blob/83866f57192fa54125595592cc09210fbc5bbfdd/src/WireMock.Net/Matchers/Request/RequestMessageHeaderMatcher.cs#L122-L125
the
_matchBehaviourvariable is still the default valueAcceptOnMatch.@StefH commented on GitHub (Feb 15, 2020):
Can you try MyGet version:
WireMock.Net.1.1.7-ci-12734.nupkg?It should be used like:
@qq362220083 commented on GitHub (Feb 20, 2020):
Wow, this code is great!
i want to pull request #423 to master branche
@StefH commented on GitHub (Feb 20, 2020):
I will merge this code in 2days and also create new NuGet