Skip to content
This repository has been archived by the owner on Dec 18, 2018. It is now read-only.

Commit

Permalink
Remove deprecated property KestrelServerOptions.MaxRequestBufferSize (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Cesar Blum Silveira authored Mar 30, 2017
1 parent 6b6a834 commit e64bffd
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,32 +34,6 @@ public class KestrelServerOptions
/// </summary>
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>
/// Provides access to request limit options.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,45 +1,14 @@
// 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 System;
using System.Linq;
using System.Net;
using System.Reflection;
using Microsoft.AspNetCore.Server.Kestrel;
using Xunit;

namespace Microsoft.AspNetCore.Server.KestrelTests
{
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]
public void NoDelayDefaultsToTrue()
{
Expand Down

0 comments on commit e64bffd

Please sign in to comment.