Merge remote-tracking branch 'origin/rel/2.0.0-preview2' into dev

This commit is contained in:
Chris R 2017-06-05 14:45:24 -07:00
commit 16c70d6dda
3 changed files with 19 additions and 2 deletions

View File

@ -76,6 +76,13 @@ namespace Microsoft.AspNetCore.Server.IISIntegration
return;
}
var bodySizeFeature = httpContext.Features.Get<IHttpMaxRequestBodySizeFeature>();
if (bodySizeFeature != null)
{
// IIS already limits this, no need to do it twice.
bodySizeFeature.MaxRequestBodySize = null;
}
if (_options.ForwardClientCertificate)
{
var header = httpContext.Request.Headers[MSAspNetCoreClientCert];

View File

@ -81,6 +81,10 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
response = await deploymentResult.HttpClient.GetAsync("/Query%3FPath?query?");
responseText = await response.Content.ReadAsStringAsync();
Assert.Equal("?query?", responseText);
response = await deploymentResult.HttpClient.GetAsync("/BodyLimit");
responseText = await response.Content.ReadAsStringAsync();
Assert.Equal("null", responseText);
}
catch (XunitException)
{

View File

@ -1,8 +1,9 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Features;
using Microsoft.Extensions.Logging;
namespace TestSites
@ -21,9 +22,14 @@ namespace TestSites
{
return ctx.Response.WriteAsync(ctx.Request.QueryString.Value);
}
if (ctx.Request.Path.Value.StartsWith("/BodyLimit"))
{
return ctx.Response.WriteAsync(
ctx.Features.Get<IHttpMaxRequestBodySizeFeature>()?.MaxRequestBodySize?.ToString() ?? "null");
}
return ctx.Response.WriteAsync("Hello World");
});
}
}
}
}