diff --git a/src/Microsoft.AspNet.Http/HttpRequest.cs b/src/Microsoft.AspNet.Http/HttpRequest.cs index 44fa1e945b..f8632e5751 100644 --- a/src/Microsoft.AspNet.Http/HttpRequest.cs +++ b/src/Microsoft.AspNet.Http/HttpRequest.cs @@ -66,16 +66,7 @@ namespace Microsoft.AspNet.Http /// Gets the form collection. /// /// The form collection parsed from the request body. - public virtual Task GetFormAsync() - { - return GetFormAsync(CancellationToken.None); - } - - /// - /// Gets the form collection. - /// - /// The form collection parsed from the request body. - public abstract Task GetFormAsync(CancellationToken cancel); + public abstract Task GetFormAsync(CancellationToken cancel = default(CancellationToken)); /// /// Gets or set the owin.RequestProtocol. diff --git a/src/Microsoft.AspNet.PipelineCore/DefaultHttpRequest.cs b/src/Microsoft.AspNet.PipelineCore/DefaultHttpRequest.cs index eba4253862..609bcf8b89 100644 --- a/src/Microsoft.AspNet.PipelineCore/DefaultHttpRequest.cs +++ b/src/Microsoft.AspNet.PipelineCore/DefaultHttpRequest.cs @@ -129,7 +129,7 @@ namespace Microsoft.AspNet.PipelineCore get { return QueryFeature.Query; } } - public override Task GetFormAsync(CancellationToken cancel) + public override Task GetFormAsync(CancellationToken cancel = default(CancellationToken)) { return FormFeature.GetFormAsync(cancel); } diff --git a/src/Microsoft.AspNet.PipelineCore/FormFeature.cs b/src/Microsoft.AspNet.PipelineCore/FormFeature.cs index 86e1d4c0f3..36b3a169c2 100644 --- a/src/Microsoft.AspNet.PipelineCore/FormFeature.cs +++ b/src/Microsoft.AspNet.PipelineCore/FormFeature.cs @@ -34,7 +34,7 @@ namespace Microsoft.AspNet.PipelineCore _bodyStream = body; if (!_bodyStream.CanSeek) { - MemoryStream buffer = new MemoryStream(); + var buffer = new MemoryStream(); await _bodyStream.CopyToAsync(buffer, 4096, cancel); _bodyStream = buffer; _request.Fetch(_features).Body = _bodyStream;