mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 21:10:32 +01:00
WithHeader cannot handle multiple requests with the same header key values #453
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 @robvangeloven on GitHub (Sep 23, 2022).
Originally assigned to: @StefH on GitHub.
When using the assertion "WithHeader" it will fail if there are multiple requests with the same header value (e.g. "Accept"):
This is because there is a ToDictionary in the WithHeader function that doesn't take into account that multiple calls might have been made before the assert fires.
@StefH commented on GitHub (Sep 26, 2022):
@robvangeloven
I think I've fixed both issues (this & _callscount).
Can you please test preview version
1.5.6-ci-16474?(https://github.com/WireMock-Net/WireMock.Net/wiki/MyGet-preview-versions)
https://github.com/WireMock-Net/WireMock.Net/pull/816
@StefH commented on GitHub (Oct 3, 2022):
@robvangeloven
Did you have time to validate?
@robvangeloven commented on GitHub (Oct 5, 2022):
@StefH Sorry, only now have time to test. The package version you mention is (no longer) available. Which version should I take for testing?
@StefH commented on GitHub (Oct 5, 2022):
can you please try
16510?@robvangeloven commented on GitHub (Oct 5, 2022):
Tried it and failed, decompilation seems to show that the code isn't merged into that branch yet. Is that possible?
@StefH commented on GitHub (Oct 5, 2022):
Sorry, wrong branch.
This id: 16511 should be it.
@robvangeloven commented on GitHub (Oct 6, 2022):
Tried it! However it now tries to match the first request made to WireMock whereas the request I'm trying to match (via the AtUrl call) is the last request
@StefH commented on GitHub (Oct 7, 2022):
@robvangeloven
Thanks for testing.
Can you please take a look at this unit test file?
https://github.com/WireMock-Net/WireMock.Net/pull/816/files#diff-e73254164873009a752dfd094e87fa8aae2d0c6c0c0b7ebe3b6d2f2b23b287c8
See line 463.
@StefH commented on GitHub (Oct 12, 2022):
https://github.com/WireMock-Net/WireMock.Net/pull/816
@robvangeloven commented on GitHub (Oct 13, 2022):
I've checked the unit test, but that one doesn't actually check any headers?
@StefH commented on GitHub (Oct 13, 2022):
Correct.
I did combine both your issues into 1 PR.
And I think both issues are solved.
In case you still have an issue, please provide a unit test.
@robvangeloven commented on GitHub (Oct 14, 2022):
Yes, retested everything and both issues are fixed!
@StefH commented on GitHub (Oct 15, 2022):
Thanks for retesting. A new NuGet version will be released this weekend.
@StefH commented on GitHub (Oct 15, 2022):
https://github.com/WireMock-Net/WireMock.Net/pull/816