mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 14:20:29 +01:00
How to validate request headers and cookies #335
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 @genesispvtltd on GitHub (Feb 11, 2021).
Hi , I just want to know how can I show unauthorized when the cookie is not passed in the request. I wrote the stub like below but it did not work.pls help to correct it thanks
Also second question is if someone passed wrong cookie say like the cookie name is pay but someone passed cookie name as paid and that time I want to display unauthorized how can i code that stub thanks.
@genesispvtltd commented on GitHub (Feb 15, 2021):
Hello, is there a way we can do this thanks.
@StefH commented on GitHub (Feb 15, 2021):
The easiest would be to:
1]
Add a mapping which uses path
"/PayrollReportService/v1/clients/208944/payrollreports*", checks the valid cookie and returns http 200.2]
Add another mapping which uses the same path, but has no check on the cookie and returns Unauthorized
@genesispvtltd commented on GitHub (Feb 16, 2021):
Thanks this worked