mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 14:20:29 +01:00
Content-Type multipart/form-data header not proxied
#693
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 @AntoineBriseboisRoy on GitHub (May 15, 2025).
Originally assigned to: @StefH on GitHub.
Describe the bug
I was having some trouble with a proxied call returning 415 status code. I then looked for the headers sent from WireMock service using the postman-echo endpoint like this:
You can clearly see that the multipart/form-data is not pass as header:
However I tried with other headers, like application/json, and this one works.
Expected behavior:
I would expect the headers to be passed using proxy.
Other related info
I noticed that this issue starts occuring in version 1.6.4 of the nuget package. Before that, all what working great.
@StefH commented on GitHub (May 15, 2025):
@AntoineBriseboisRoy
Thanks for this noticing this bug.
Beside this error, the whole body is not proxied...
I'll fix it.
@StefH commented on GitHub (May 15, 2025):
https://github.com/wiremock/WireMock.Net/pull/1296
@StefH commented on GitHub (May 15, 2025):
@AntoineBriseboisRoy
Can you confirm that indeed the body is missing in the echo postman?
@AntoineBriseboisRoy commented on GitHub (May 15, 2025):
I'm sending a body like this one:
And the screenshot I showed you at first doesn't seem to have a returned body. So yeah.
@AntoineBriseboisRoy commented on GitHub (May 15, 2025):
Thank you for the fix. Can you tell me when the new Nuget will be available?
@StefH commented on GitHub (May 15, 2025):
In 1 hour
@AntoineBriseboisRoy commented on GitHub (May 16, 2025):
@StefH I hate to say this but the fix is not working:
All the requests I do using multipart/form-data Content-Type while proxy return that, even the postman echo one that was working before. Any idea?
@StefH commented on GitHub (May 16, 2025):
I think there is too much business logic in WireMock.Net which tries to understand the header + body.
In your example, you use header Content-Type multipart/form-data but the body is json, and this does not match.
So try sending:
Content-Type multipart/form-dataBut in this case, I think that an exception is thrown, this should be fixed.
@StefH commented on GitHub (May 16, 2025):
https://github.com/wiremock/WireMock.Net/pull/1297
@AntoineBriseboisRoy commented on GitHub (May 21, 2025):
Any news on that?
@StefH commented on GitHub (May 22, 2025):
@AntoineBriseboisRoy
PR is merged; I'll create a new NuGet today