Bug 11870 - Parsing of HTTP POST ContentType doesn't work the same as the .NET version
Summary: Parsing of HTTP POST ContentType doesn't work the same as the .NET version
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Web ()
Version: master
Hardware: PC All
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2013-04-19 16:47 UTC by peter+xamarin
Modified: 2014-07-29 07:15 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report for Bug 11870 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description peter+xamarin 2013-04-19 16:47:58 UTC
I was having some issues with ASP.NET MVC when I tried to POST a multipart form to it with a file in it.

In ASP.NET MVC you can access the Request.Files and in official .NET 4 it would show 1 file in it.
However, when running the latest 3.0.9 XSP4 it would give me 0 files. So somehow the parsing failed.

I finally found that the following ContentType header is handled differently in .NET and MONO:
Content-Type: multipart/form-data;boundary=---------------------------14737809831466499882746641449
.NET => understands it 
MONO => doesn't

However, adding a SPACE between "form-data;" and "boundary" makes it work ok in both versions:
Content-Type: multipart/form-data; boundary=---------------------------14737809831466499882746641449
.NET => OK

As the used MVC library is the same, I assume ASP.NET is responsible and in Mono somehow needs that space between arguments in Content-Type.
I don't know what the official specification of HTTP requests says about this, but it definitely works in .NET, so should be working in MONO.
Comment 1 peter+xamarin 2013-04-19 16:50:50 UTC
To make it more clear, due to formatting issues:
"Content-Type: multipart/form-data; boundary=[..]"
"Content-Type: multipart/form-data;boundary=[..]"