Skip to content
This repository was archived by the owner on Nov 20, 2018. It is now read-only.

Commit 5f58bef

Browse files
committed
Removed ContentDispositionHeaderValue parameter
1 parent f8bb6f6 commit 5f58bef

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/Microsoft.AspNet.Http/Features/FormFeature.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,10 @@ private async Task<IFormCollection> InnerReadFormAsync(CancellationToken cancell
149149
// Find the end
150150
await section.Body.DrainAsync(cancellationToken);
151151

152-
var file = new FormFile(_request.Body, section.BaseStreamOffset.Value, section.Body.Length, contentDisposition)
152+
var name = HeaderUtilities.RemoveQuotes(contentDisposition.Name) ?? string.Empty;
153+
var fileName = HeaderUtilities.RemoveQuotes(contentDisposition.FileName) ?? string.Empty;
154+
155+
var file = new FormFile(_request.Body, section.BaseStreamOffset.Value, section.Body.Length, name, fileName)
153156
{
154157
Headers = new HeaderDictionary(section.Headers),
155158
};

src/Microsoft.AspNet.Http/Features/FormFile.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
using System.IO;
55
using Microsoft.AspNet.Http.Internal;
6-
using Microsoft.Net.Http.Headers;
7-
using static Microsoft.Net.Http.Headers.HeaderUtilities;
86

97
namespace Microsoft.AspNet.Http.Features.Internal
108
{
@@ -13,13 +11,13 @@ public class FormFile : IFormFile
1311
private readonly Stream _baseStream;
1412
private readonly long _baseStreamOffset;
1513

16-
public FormFile(Stream baseStream, long baseStreamOffset, long length, ContentDispositionHeaderValue contentDisposition)
14+
public FormFile(Stream baseStream, long baseStreamOffset, long length, string name, string fileName)
1715
{
1816
_baseStream = baseStream;
1917
_baseStreamOffset = baseStreamOffset;
2018
Length = length;
21-
Name = RemoveQuotes(contentDisposition.Name) ?? string.Empty;
22-
FileName = RemoveQuotes(contentDisposition.FileName) ?? string.Empty;
19+
Name = name;
20+
FileName = fileName;
2321
}
2422

2523
public string ContentDisposition

0 commit comments

Comments
 (0)