Proxy mode: Incorrect handling of multipart requests #271

Closed
opened 2025-12-29 08:25:12 +01:00 by adam · 6 comments
Owner

Originally created by @LevYas on GitHub (May 17, 2020).

I have an ASP.Net Core API method with the following signature

[HttpPut("pic")]
public ActionResult UpdatePicture(IFormFile file)

I call this method from Postman or curl or from my front-end with a small picture file. It's ok without proxy, but with proxy file is always null.

It looks like WireMock.Net treats multipart requests as a single part request with raw data, but I can be wrong. I added reading the Form field and it contains the right content:
2020-05-17 14_34_07-WireMock Net Solution (Debugging) - Microsoft Visual Studio

I created a repro here https://github.com/LevYas/WireMockNetRepro

Originally created by @LevYas on GitHub (May 17, 2020). I have an ASP.Net Core API method with the following signature ``` [HttpPut("pic")] public ActionResult UpdatePicture(IFormFile file) ``` I call this method from Postman or curl or from my front-end with a small picture file. It's ok without proxy, but with proxy file is always null. It looks like WireMock.Net treats multipart requests as a single part request with raw data, but I can be wrong. I added reading the `Form` field and it contains the right content: ![2020-05-17 14_34_07-WireMock Net Solution (Debugging) - Microsoft Visual Studio](https://user-images.githubusercontent.com/36070899/82152438-ce65fd80-9869-11ea-9d01-d424a876d2f5.png) I created a repro here https://github.com/LevYas/WireMockNetRepro
adam added the bug label 2025-12-29 08:25:12 +01:00
adam closed this issue 2025-12-29 08:25:12 +01:00
Author
Owner

@StefH commented on GitHub (May 22, 2020):

Bug is confirmed, thanks for analyzing.

However fixing will take some time...

@StefH commented on GitHub (May 22, 2020): Bug is confirmed, thanks for analyzing. However fixing will take some time...
Author
Owner

@LevYas commented on GitHub (May 22, 2020):

You are welcome. Yeah, fix will not be trivial, especially bearing in mind different target frameworks.

@LevYas commented on GitHub (May 22, 2020): You are welcome. Yeah, fix will not be trivial, especially bearing in mind different target frameworks.
Author
Owner

@StefH commented on GitHub (May 23, 2020):

https://github.com/WireMock-Net/WireMock.Net/pull/473

@StefH commented on GitHub (May 23, 2020): https://github.com/WireMock-Net/WireMock.Net/pull/473
Author
Owner

@StefH commented on GitHub (May 23, 2020):

@LevYas Can you try version WireMock.Net.1.2.11-ci-13392 ?

@StefH commented on GitHub (May 23, 2020): @LevYas Can you try version `WireMock.Net.1.2.11-ci-13392` ?
Author
Owner

@LevYas commented on GitHub (May 23, 2020):

@StefH - you are incredibly fast. I've just tested - it works!

@LevYas commented on GitHub (May 23, 2020): @StefH - you are incredibly fast. I've just tested - it works!
Author
Owner

@StefH commented on GitHub (May 23, 2020):

You are a very good tester!

I will make new official version today.

@StefH commented on GitHub (May 23, 2020): You are a very good tester! I will make new official version today.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/WireMock.Net#271