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 (show other bugs)
Version: master
Hardware: PC All
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-04-19 16:47 UTC by peter+xamarin
Modified: 2014-07-29 07:15 UTC (History)
2 users (show)

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


Attachments

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
MONO => 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:
Works: 
"Content-Type: multipart/form-data; boundary=[..]"
Doesn't:
"Content-Type: multipart/form-data;boundary=[..]"

Note You need to log in before you can comment on or make changes to this bug.