Remove deprecated property KestrelServerOptions.MaxRequestBufferSize (#1027).
This commit is contained in:
parent
6b6a8347cc
commit
e64bffd25c
|
|
@ -34,32 +34,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public IServiceProvider ApplicationServices { get; set; }
|
public IServiceProvider ApplicationServices { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// <para>
|
|
||||||
/// This property is obsolete and will be removed in a future version.
|
|
||||||
/// Use <c>Limits.MaxRequestBufferSize</c> instead.
|
|
||||||
/// </para>
|
|
||||||
/// <para>
|
|
||||||
/// Gets or sets the maximum size of the request buffer.
|
|
||||||
/// </para>
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// When set to null, the size of the request buffer is unlimited.
|
|
||||||
/// Defaults to 1,048,576 bytes (1 MB).
|
|
||||||
/// </remarks>
|
|
||||||
[Obsolete("This property is obsolete and will be removed in a future version. Use Limits.MaxRequestBufferSize instead.")]
|
|
||||||
public long? MaxRequestBufferSize
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return Limits.MaxRequestBufferSize;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
Limits.MaxRequestBufferSize = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Provides access to request limit options.
|
/// Provides access to request limit options.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,7 @@
|
||||||
// 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.
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Reflection;
|
|
||||||
using Microsoft.AspNetCore.Server.Kestrel;
|
using Microsoft.AspNetCore.Server.Kestrel;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
|
|
@ -12,34 +9,6 @@ namespace Microsoft.AspNetCore.Server.KestrelTests
|
||||||
{
|
{
|
||||||
public class KestrelServerOptionsTests
|
public class KestrelServerOptionsTests
|
||||||
{
|
{
|
||||||
#pragma warning disable CS0618
|
|
||||||
[Fact]
|
|
||||||
public void MaxRequestBufferSizeIsMarkedObsolete()
|
|
||||||
{
|
|
||||||
Assert.NotNull(typeof(KestrelServerOptions)
|
|
||||||
.GetProperty(nameof(KestrelServerOptions.MaxRequestBufferSize))
|
|
||||||
.GetCustomAttributes(false)
|
|
||||||
.OfType<ObsoleteAttribute>()
|
|
||||||
.SingleOrDefault());
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void MaxRequestBufferSizeGetsLimitsProperty()
|
|
||||||
{
|
|
||||||
var o = new KestrelServerOptions();
|
|
||||||
o.Limits.MaxRequestBufferSize = 42;
|
|
||||||
Assert.Equal(42, o.MaxRequestBufferSize);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Fact]
|
|
||||||
public void MaxRequestBufferSizeSetsLimitsProperty()
|
|
||||||
{
|
|
||||||
var o = new KestrelServerOptions();
|
|
||||||
o.MaxRequestBufferSize = 42;
|
|
||||||
Assert.Equal(42, o.Limits.MaxRequestBufferSize);
|
|
||||||
}
|
|
||||||
#pragma warning restore CS0612
|
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void NoDelayDefaultsToTrue()
|
public void NoDelayDefaultsToTrue()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue