Skip to content

Commit a9b18e3

Browse files
Merge commit 'e5f183b656a0e8bc087108130a5a9b54ae94494e' into internal-merge-6.0-2022-05-10-1209
2 parents fd5cd43 + e5f183b commit a9b18e3

File tree

8 files changed

+143
-62
lines changed

8 files changed

+143
-62
lines changed

NuGet.config

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
<clear />
55
<!--Begin: Package sources managed by Dependency Flow automation. Do not edit the sources below.-->
66
<!-- Begin: Package sources from dotnet-runtime -->
7+
<add key="darc-int-dotnet-runtime-70ae3df" value="https://pkgs.dev.azure.com/dnceng/internal/_packaging/darc-int-dotnet-runtime-70ae3df4/nuget/v3/index.json" />
78
<!-- End: Package sources from dotnet-runtime -->
89
<!-- Begin: Package sources from dotnet-efcore -->
10+
<add key="darc-int-dotnet-efcore-9b03633" value="https://pkgs.dev.azure.com/dnceng/internal/_packaging/darc-int-dotnet-efcore-9b03633b/nuget/v3/index.json" />
911
<!-- End: Package sources from dotnet-efcore -->
1012
<!--End: Package sources managed by Dependency Flow automation. Do not edit the sources above.-->
1113
<add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" />
@@ -25,8 +27,10 @@
2527
<clear />
2628
<!--Begin: Package sources managed by Dependency Flow automation. Do not edit the sources below.-->
2729
<!-- Begin: Package sources from dotnet-efcore -->
30+
<add key="darc-int-dotnet-efcore-9b03633" value="true" />
2831
<!-- End: Package sources from dotnet-efcore -->
2932
<!-- Begin: Package sources from dotnet-runtime -->
33+
<add key="darc-int-dotnet-runtime-70ae3df" value="true" />
3034
<!-- End: Package sources from dotnet-runtime -->
3135
<!--End: Package sources managed by Dependency Flow automation. Do not edit the sources above.-->
3236
</disabledPackageSources>

eng/Version.Details.xml

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -9,37 +9,37 @@
99
-->
1010
<Dependencies>
1111
<ProductDependencies>
12-
<Dependency Name="dotnet-ef" Version="6.0.4">
12+
<Dependency Name="dotnet-ef" Version="6.0.5">
1313
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-efcore</Uri>
14-
<Sha>aca50aef8604cc23910d18edce820e0fa7c61910</Sha>
14+
<Sha>9b03633bb18b617088b32260065ee385bf9c4491</Sha>
1515
</Dependency>
16-
<Dependency Name="Microsoft.EntityFrameworkCore.InMemory" Version="6.0.4">
16+
<Dependency Name="Microsoft.EntityFrameworkCore.InMemory" Version="6.0.5">
1717
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-efcore</Uri>
18-
<Sha>aca50aef8604cc23910d18edce820e0fa7c61910</Sha>
18+
<Sha>9b03633bb18b617088b32260065ee385bf9c4491</Sha>
1919
</Dependency>
20-
<Dependency Name="Microsoft.EntityFrameworkCore.Relational" Version="6.0.4">
20+
<Dependency Name="Microsoft.EntityFrameworkCore.Relational" Version="6.0.5">
2121
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-efcore</Uri>
22-
<Sha>aca50aef8604cc23910d18edce820e0fa7c61910</Sha>
22+
<Sha>9b03633bb18b617088b32260065ee385bf9c4491</Sha>
2323
</Dependency>
24-
<Dependency Name="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.4">
24+
<Dependency Name="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.5">
2525
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-efcore</Uri>
26-
<Sha>aca50aef8604cc23910d18edce820e0fa7c61910</Sha>
26+
<Sha>9b03633bb18b617088b32260065ee385bf9c4491</Sha>
2727
</Dependency>
28-
<Dependency Name="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.4">
28+
<Dependency Name="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.5">
2929
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-efcore</Uri>
30-
<Sha>aca50aef8604cc23910d18edce820e0fa7c61910</Sha>
30+
<Sha>9b03633bb18b617088b32260065ee385bf9c4491</Sha>
3131
</Dependency>
32-
<Dependency Name="Microsoft.EntityFrameworkCore.Tools" Version="6.0.4">
32+
<Dependency Name="Microsoft.EntityFrameworkCore.Tools" Version="6.0.5">
3333
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-efcore</Uri>
34-
<Sha>aca50aef8604cc23910d18edce820e0fa7c61910</Sha>
34+
<Sha>9b03633bb18b617088b32260065ee385bf9c4491</Sha>
3535
</Dependency>
36-
<Dependency Name="Microsoft.EntityFrameworkCore" Version="6.0.4">
36+
<Dependency Name="Microsoft.EntityFrameworkCore" Version="6.0.5">
3737
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-efcore</Uri>
38-
<Sha>aca50aef8604cc23910d18edce820e0fa7c61910</Sha>
38+
<Sha>9b03633bb18b617088b32260065ee385bf9c4491</Sha>
3939
</Dependency>
40-
<Dependency Name="Microsoft.EntityFrameworkCore.Design" Version="6.0.4">
40+
<Dependency Name="Microsoft.EntityFrameworkCore.Design" Version="6.0.5">
4141
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-efcore</Uri>
42-
<Sha>aca50aef8604cc23910d18edce820e0fa7c61910</Sha>
42+
<Sha>9b03633bb18b617088b32260065ee385bf9c4491</Sha>
4343
</Dependency>
4444
<Dependency Name="Microsoft.Extensions.Caching.Abstractions" Version="6.0.0">
4545
<Uri>https://github.com/dotnet/runtime</Uri>
@@ -177,9 +177,9 @@
177177
<Uri>https://github.com/dotnet/runtime</Uri>
178178
<Sha>4822e3c3aa77eb82b2fb33c9321f923cf11ddde6</Sha>
179179
</Dependency>
180-
<Dependency Name="Microsoft.Internal.Runtime.AspNetCore.Transport" Version="6.0.4-servicing.22164.4">
180+
<Dependency Name="Microsoft.Internal.Runtime.AspNetCore.Transport" Version="6.0.5-servicing.22213.9">
181181
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
182-
<Sha>be98e88c760526452df94ef452fff4602fb5bded</Sha>
182+
<Sha>70ae3df4a6f3c92fb6b315afc405edd10ff38579</Sha>
183183
</Dependency>
184184
<Dependency Name="System.Diagnostics.DiagnosticSource" Version="6.0.0">
185185
<Uri>https://github.com/dotnet/runtime</Uri>
@@ -193,9 +193,9 @@
193193
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
194194
<Sha>839cdfb0ecca5e0be3dbccd926e7651ef50fdf10</Sha>
195195
</Dependency>
196-
<Dependency Name="System.IO.Pipelines" Version="6.0.2">
196+
<Dependency Name="System.IO.Pipelines" Version="6.0.3">
197197
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
198-
<Sha>839cdfb0ecca5e0be3dbccd926e7651ef50fdf10</Sha>
198+
<Sha>70ae3df4a6f3c92fb6b315afc405edd10ff38579</Sha>
199199
</Dependency>
200200
<Dependency Name="System.Net.Http.Json" Version="6.0.0">
201201
<Uri>https://github.com/dotnet/runtime</Uri>
@@ -217,9 +217,9 @@
217217
<Uri>https://github.com/dotnet/runtime</Uri>
218218
<Sha>4822e3c3aa77eb82b2fb33c9321f923cf11ddde6</Sha>
219219
</Dependency>
220-
<Dependency Name="System.Security.Cryptography.Pkcs" Version="6.0.0">
221-
<Uri>https://github.com/dotnet/runtime</Uri>
222-
<Sha>4822e3c3aa77eb82b2fb33c9321f923cf11ddde6</Sha>
220+
<Dependency Name="System.Security.Cryptography.Pkcs" Version="6.0.1">
221+
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
222+
<Sha>70ae3df4a6f3c92fb6b315afc405edd10ff38579</Sha>
223223
</Dependency>
224224
<Dependency Name="System.Security.Cryptography.Xml" Version="6.0.0">
225225
<Uri>https://github.com/dotnet/runtime</Uri>
@@ -233,9 +233,9 @@
233233
<Uri>https://github.com/dotnet/runtime</Uri>
234234
<Sha>4822e3c3aa77eb82b2fb33c9321f923cf11ddde6</Sha>
235235
</Dependency>
236-
<Dependency Name="System.Text.Json" Version="6.0.3">
236+
<Dependency Name="System.Text.Json" Version="6.0.4">
237237
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
238-
<Sha>be98e88c760526452df94ef452fff4602fb5bded</Sha>
238+
<Sha>70ae3df4a6f3c92fb6b315afc405edd10ff38579</Sha>
239239
</Dependency>
240240
<Dependency Name="System.Threading.Channels" Version="6.0.0">
241241
<Uri>https://github.com/dotnet/runtime</Uri>
@@ -245,33 +245,33 @@
245245
<Uri>https://github.com/dotnet/runtime</Uri>
246246
<Sha>4822e3c3aa77eb82b2fb33c9321f923cf11ddde6</Sha>
247247
</Dependency>
248-
<Dependency Name="Microsoft.NETCore.App.Ref" Version="6.0.4">
248+
<Dependency Name="Microsoft.NETCore.App.Ref" Version="6.0.5">
249249
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
250-
<Sha>be98e88c760526452df94ef452fff4602fb5bded</Sha>
250+
<Sha>70ae3df4a6f3c92fb6b315afc405edd10ff38579</Sha>
251251
</Dependency>
252-
<Dependency Name="Microsoft.NET.Runtime.MonoAOTCompiler.Task" Version="6.0.4">
252+
<Dependency Name="Microsoft.NET.Runtime.MonoAOTCompiler.Task" Version="6.0.5">
253253
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
254-
<Sha>be98e88c760526452df94ef452fff4602fb5bded</Sha>
254+
<Sha>70ae3df4a6f3c92fb6b315afc405edd10ff38579</Sha>
255255
</Dependency>
256-
<Dependency Name="Microsoft.NET.Runtime.WebAssembly.Sdk" Version="6.0.4">
256+
<Dependency Name="Microsoft.NET.Runtime.WebAssembly.Sdk" Version="6.0.5">
257257
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
258-
<Sha>be98e88c760526452df94ef452fff4602fb5bded</Sha>
258+
<Sha>70ae3df4a6f3c92fb6b315afc405edd10ff38579</Sha>
259259
</Dependency>
260260
<!--
261261
Win-x64 is used here because we have picked an arbitrary runtime identifier to flow the version of the latest NETCore.App runtime.
262262
All Runtime.$rid packages should have the same version.
263263
-->
264-
<Dependency Name="Microsoft.NETCore.App.Runtime.win-x64" Version="6.0.4">
264+
<Dependency Name="Microsoft.NETCore.App.Runtime.win-x64" Version="6.0.5">
265265
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
266-
<Sha>be98e88c760526452df94ef452fff4602fb5bded</Sha>
266+
<Sha>70ae3df4a6f3c92fb6b315afc405edd10ff38579</Sha>
267267
</Dependency>
268-
<Dependency Name="Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.browser-wasm" Version="6.0.4">
268+
<Dependency Name="Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.browser-wasm" Version="6.0.5">
269269
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
270-
<Sha>be98e88c760526452df94ef452fff4602fb5bded</Sha>
270+
<Sha>70ae3df4a6f3c92fb6b315afc405edd10ff38579</Sha>
271271
</Dependency>
272-
<Dependency Name="Microsoft.NETCore.BrowserDebugHost.Transport" Version="6.0.4-servicing.22164.4">
272+
<Dependency Name="Microsoft.NETCore.BrowserDebugHost.Transport" Version="6.0.5-servicing.22213.9">
273273
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
274-
<Sha>be98e88c760526452df94ef452fff4602fb5bded</Sha>
274+
<Sha>70ae3df4a6f3c92fb6b315afc405edd10ff38579</Sha>
275275
</Dependency>
276276
</ProductDependencies>
277277
<ToolsetDependencies>

eng/Versions.props

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@
6363
<PropertyGroup Label="Automated">
6464
<!-- Packages from dotnet/runtime -->
6565
<MicrosoftExtensionsDependencyModelVersion>6.0.0</MicrosoftExtensionsDependencyModelVersion>
66-
<MicrosoftNETCoreAppRefVersion>6.0.4</MicrosoftNETCoreAppRefVersion>
67-
<MicrosoftNETCoreAppRuntimewinx64Version>6.0.4</MicrosoftNETCoreAppRuntimewinx64Version>
68-
<MicrosoftNETRuntimeMonoAOTCompilerTaskVersion>6.0.4</MicrosoftNETRuntimeMonoAOTCompilerTaskVersion>
69-
<MicrosoftNETRuntimeWebAssemblySdkVersion>6.0.4</MicrosoftNETRuntimeWebAssemblySdkVersion>
70-
<MicrosoftNETCoreAppRuntimeAOTwinx64CrossbrowserwasmVersion>6.0.4</MicrosoftNETCoreAppRuntimeAOTwinx64CrossbrowserwasmVersion>
71-
<MicrosoftNETCoreBrowserDebugHostTransportVersion>6.0.4-servicing.22164.4</MicrosoftNETCoreBrowserDebugHostTransportVersion>
66+
<MicrosoftNETCoreAppRefVersion>6.0.5</MicrosoftNETCoreAppRefVersion>
67+
<MicrosoftNETCoreAppRuntimewinx64Version>6.0.5</MicrosoftNETCoreAppRuntimewinx64Version>
68+
<MicrosoftNETRuntimeMonoAOTCompilerTaskVersion>6.0.5</MicrosoftNETRuntimeMonoAOTCompilerTaskVersion>
69+
<MicrosoftNETRuntimeWebAssemblySdkVersion>6.0.5</MicrosoftNETRuntimeWebAssemblySdkVersion>
70+
<MicrosoftNETCoreAppRuntimeAOTwinx64CrossbrowserwasmVersion>6.0.5</MicrosoftNETCoreAppRuntimeAOTwinx64CrossbrowserwasmVersion>
71+
<MicrosoftNETCoreBrowserDebugHostTransportVersion>6.0.5-servicing.22213.9</MicrosoftNETCoreBrowserDebugHostTransportVersion>
7272
<MicrosoftExtensionsCachingAbstractionsVersion>6.0.0</MicrosoftExtensionsCachingAbstractionsVersion>
7373
<MicrosoftExtensionsCachingMemoryVersion>6.0.1</MicrosoftExtensionsCachingMemoryVersion>
7474
<MicrosoftExtensionsConfigurationAbstractionsVersion>6.0.0</MicrosoftExtensionsConfigurationAbstractionsVersion>
@@ -103,33 +103,33 @@
103103
<MicrosoftExtensionsOptionsDataAnnotationsVersion>6.0.0</MicrosoftExtensionsOptionsDataAnnotationsVersion>
104104
<MicrosoftExtensionsOptionsVersion>6.0.0</MicrosoftExtensionsOptionsVersion>
105105
<MicrosoftExtensionsPrimitivesVersion>6.0.0</MicrosoftExtensionsPrimitivesVersion>
106-
<MicrosoftInternalRuntimeAspNetCoreTransportVersion>6.0.4-servicing.22164.4</MicrosoftInternalRuntimeAspNetCoreTransportVersion>
106+
<MicrosoftInternalRuntimeAspNetCoreTransportVersion>6.0.5-servicing.22213.9</MicrosoftInternalRuntimeAspNetCoreTransportVersion>
107107
<SystemDiagnosticsDiagnosticSourceVersion>6.0.0</SystemDiagnosticsDiagnosticSourceVersion>
108108
<SystemDiagnosticsEventLogVersion>6.0.0</SystemDiagnosticsEventLogVersion>
109109
<SystemDirectoryServicesProtocolsVersion>6.0.1</SystemDirectoryServicesProtocolsVersion>
110-
<SystemIOPipelinesVersion>6.0.2</SystemIOPipelinesVersion>
110+
<SystemIOPipelinesVersion>6.0.3</SystemIOPipelinesVersion>
111111
<SystemNetHttpJsonVersion>6.0.0</SystemNetHttpJsonVersion>
112112
<SystemNetHttpWinHttpHandlerVersion>6.0.1</SystemNetHttpWinHttpHandlerVersion>
113113
<SystemReflectionMetadataVersion>6.0.1</SystemReflectionMetadataVersion>
114114
<SystemResourcesExtensionsVersion>6.0.0</SystemResourcesExtensionsVersion>
115115
<SystemRuntimeCompilerServicesUnsafeVersion>6.0.0</SystemRuntimeCompilerServicesUnsafeVersion>
116-
<SystemSecurityCryptographyPkcsVersion>6.0.0</SystemSecurityCryptographyPkcsVersion>
116+
<SystemSecurityCryptographyPkcsVersion>6.0.1</SystemSecurityCryptographyPkcsVersion>
117117
<SystemSecurityCryptographyXmlVersion>6.0.0</SystemSecurityCryptographyXmlVersion>
118118
<SystemServiceProcessServiceControllerVersion>6.0.0</SystemServiceProcessServiceControllerVersion>
119119
<SystemTextEncodingsWebVersion>6.0.0</SystemTextEncodingsWebVersion>
120-
<SystemTextJsonVersion>6.0.3</SystemTextJsonVersion>
120+
<SystemTextJsonVersion>6.0.4</SystemTextJsonVersion>
121121
<SystemThreadingChannelsVersion>6.0.0</SystemThreadingChannelsVersion>
122122
<!-- Only listed explicitly to workaround https://github.com/dotnet/cli/issues/10528 -->
123123
<MicrosoftNETCorePlatformsVersion>6.0.3</MicrosoftNETCorePlatformsVersion>
124124
<!-- Packages from dotnet/efcore -->
125-
<dotnetefVersion>6.0.4</dotnetefVersion>
126-
<MicrosoftEntityFrameworkCoreInMemoryVersion>6.0.4</MicrosoftEntityFrameworkCoreInMemoryVersion>
127-
<MicrosoftEntityFrameworkCoreRelationalVersion>6.0.4</MicrosoftEntityFrameworkCoreRelationalVersion>
128-
<MicrosoftEntityFrameworkCoreSqliteVersion>6.0.4</MicrosoftEntityFrameworkCoreSqliteVersion>
129-
<MicrosoftEntityFrameworkCoreSqlServerVersion>6.0.4</MicrosoftEntityFrameworkCoreSqlServerVersion>
130-
<MicrosoftEntityFrameworkCoreToolsVersion>6.0.4</MicrosoftEntityFrameworkCoreToolsVersion>
131-
<MicrosoftEntityFrameworkCoreVersion>6.0.4</MicrosoftEntityFrameworkCoreVersion>
132-
<MicrosoftEntityFrameworkCoreDesignVersion>6.0.4</MicrosoftEntityFrameworkCoreDesignVersion>
125+
<dotnetefVersion>6.0.5</dotnetefVersion>
126+
<MicrosoftEntityFrameworkCoreInMemoryVersion>6.0.5</MicrosoftEntityFrameworkCoreInMemoryVersion>
127+
<MicrosoftEntityFrameworkCoreRelationalVersion>6.0.5</MicrosoftEntityFrameworkCoreRelationalVersion>
128+
<MicrosoftEntityFrameworkCoreSqliteVersion>6.0.5</MicrosoftEntityFrameworkCoreSqliteVersion>
129+
<MicrosoftEntityFrameworkCoreSqlServerVersion>6.0.5</MicrosoftEntityFrameworkCoreSqlServerVersion>
130+
<MicrosoftEntityFrameworkCoreToolsVersion>6.0.5</MicrosoftEntityFrameworkCoreToolsVersion>
131+
<MicrosoftEntityFrameworkCoreVersion>6.0.5</MicrosoftEntityFrameworkCoreVersion>
132+
<MicrosoftEntityFrameworkCoreDesignVersion>6.0.5</MicrosoftEntityFrameworkCoreDesignVersion>
133133
<!-- Packages from dotnet/arcade -->
134134
<MicrosoftDotNetBuildTasksInstallersVersion>6.0.0-beta.22254.3</MicrosoftDotNetBuildTasksInstallersVersion>
135135
<MicrosoftDotNetBuildTasksTemplatingVersion>6.0.0-beta.22254.3</MicrosoftDotNetBuildTasksTemplatingVersion>

eng/helix/helix.proj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
not HelixCorrelationPayload.
1111
-->
1212
<PropertyGroup>
13-
<IsPublicRuntime>true</IsPublicRuntime>
13+
<IsPublicRuntime>false</IsPublicRuntime>
1414
</PropertyGroup>
1515

1616
<PropertyGroup>

src/Http/Http/src/Features/FormFeature.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ private async Task<IFormCollection> InnerReadFormAsync(CancellationToken cancell
184184
else if (HasMultipartFormContentType(contentType))
185185
{
186186
var formAccumulator = new KeyValueAccumulator();
187+
var nonFormOrFileContentDispositionCount = 0;
187188

188189
var boundary = GetBoundary(contentType, _options.MultipartBoundaryLengthLimit);
189190
var multipartReader = new MultipartReader(boundary, _request.Body)
@@ -259,7 +260,11 @@ private async Task<IFormCollection> InnerReadFormAsync(CancellationToken cancell
259260
}
260261
else
261262
{
262-
System.Diagnostics.Debug.Assert(false, "Unrecognized content-disposition for this section: " + section.ContentDisposition);
263+
if (nonFormOrFileContentDispositionCount++ >= _options.ValueCountLimit)
264+
{
265+
throw new InvalidDataException($"Unrecognized Content-Disposition. Form value count limit {_options.ValueCountLimit} exceeded.");
266+
267+
}
263268
}
264269

265270
section = await multipartReader.ReadNextSectionAsync(cancellationToken);

src/Http/Http/test/Features/FormFeatureTests.cs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,12 @@ private class MockRequestBodyPipeFeature : IRequestBodyPipeFeature
165165
InvalidContentDispositionValue +
166166
"\r\n" +
167167
"\r\n" +
168+
"Foo\r\n";
169+
170+
private const string MultipartFormFileNonFormOrFileContentDispositionValue = "--WebKitFormBoundary5pDRpGheQXaM8k3T\r\n" +
171+
"Content-Disposition:x" +
172+
"\r\n" +
173+
"\r\n" +
168174
"Foo\r\n";
169175

170176
private const string MultipartFormWithField =
@@ -468,6 +474,30 @@ public async Task ReadFormAsync_ValueCountLimitExceeded_Throw(bool bufferRequest
468474
Assert.Equal("Form value count limit 2 exceeded.", exception.Message);
469475
}
470476

477+
[Theory]
478+
[InlineData(true)]
479+
[InlineData(false)]
480+
public async Task ReadFormAsync_NonFormOrFieldContentDisposition_ValueCountLimitExceeded_Throw(bool bufferRequest)
481+
{
482+
var formContent = new List<byte>();
483+
formContent.AddRange(Encoding.UTF8.GetBytes(MultipartFormFileNonFormOrFileContentDispositionValue));
484+
formContent.AddRange(Encoding.UTF8.GetBytes(MultipartFormFileNonFormOrFileContentDispositionValue));
485+
formContent.AddRange(Encoding.UTF8.GetBytes(MultipartFormFileNonFormOrFileContentDispositionValue));
486+
formContent.AddRange(Encoding.UTF8.GetBytes(MultipartFormEnd));
487+
488+
var context = new DefaultHttpContext();
489+
var responseFeature = new FakeResponseFeature();
490+
context.Features.Set<IHttpResponseFeature>(responseFeature);
491+
context.Request.ContentType = MultipartContentType;
492+
context.Request.Body = new NonSeekableReadStream(formContent.ToArray());
493+
494+
IFormFeature formFeature = new FormFeature(context.Request, new FormOptions() { BufferBody = bufferRequest, ValueCountLimit = 2 });
495+
context.Features.Set<IFormFeature>(formFeature);
496+
497+
var exception = await Assert.ThrowsAsync<InvalidDataException>(() => context.Request.ReadFormAsync());
498+
Assert.Equal("Unrecognized Content-Disposition. Form value count limit 2 exceeded.", exception.Message);
499+
}
500+
471501
[Theory]
472502
[InlineData(true)]
473503
[InlineData(false)]

0 commit comments

Comments
 (0)