mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 22:30:41 +01:00
Exact byte array request matching fails on specific byte arrays #344
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 @Archomeda on GitHub (Apr 12, 2021).
Originally assigned to: @StefH on GitHub.
Describe the bug
Exact matching on byte arrays sometimes fails, depending on the byte array contents.
Expected behavior:
Exact matching should succeed, no matter what the byte array contents are, as long as it's the same.
Test to reproduce
The following code reproduces the bug:
The output:
Other related info
From my limited debugging, I've noticed that the request log shows different behavior. In the first case, it shows that DetectedBodyType = Bytes, while in the second case it's DetectedBodyType = String. In both cases the DetectedBodyTypeFromContentType = Bytes.
I don't expect WireMock to transform a request to a string automatically and then fail to match because it expects a byte array.
@StefH commented on GitHub (Apr 16, 2021):
The different DetectedBodyType should not cause this error I think.
I'll take a look what's the root cause.
Thank you for noticing this issue.
@StefH commented on GitHub (Apr 18, 2021):
New version will be released soon.
@Archomeda commented on GitHub (Apr 19, 2021):
Cool, thanks! 👍