diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs index 1bfcb52704..29af99d462 100644 --- a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs @@ -51,15 +51,15 @@ namespace Microsoft.AspNet.StaticFiles public Task Invoke(HttpContext context) { // Check if there is a SendFile feature already present - if (context.GetFeature() == null) + if (context.GetFeature() == null) { - context.SetFeature(new SendFileWrapper(context.Response.Body)); + context.SetFeature(new SendFileWrapper(context.Response.Body)); } return _next(context); } - private class SendFileWrapper : IHttpSendFile + private class SendFileWrapper : IHttpSendFileFeature { private readonly Stream _output; diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileResponseExtensions.cs b/src/Microsoft.AspNet.StaticFiles/SendFileResponseExtensions.cs index 49511ecb35..f70465fa25 100644 --- a/src/Microsoft.AspNet.StaticFiles/SendFileResponseExtensions.cs +++ b/src/Microsoft.AspNet.StaticFiles/SendFileResponseExtensions.cs @@ -39,7 +39,7 @@ namespace Microsoft.AspNet.StaticFiles { throw new ArgumentNullException("response"); } - return response.HttpContext.GetFeature() != null; + return response.HttpContext.GetFeature() != null; } /// @@ -72,7 +72,7 @@ namespace Microsoft.AspNet.StaticFiles { throw new ArgumentNullException("response"); } - IHttpSendFile sendFile = response.HttpContext.GetFeature(); + var sendFile = response.HttpContext.GetFeature(); if (sendFile == null) { throw new NotSupportedException(Resources.Exception_SendFileNotSupported); diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs index 20de3c6bb3..e08779ef60 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs @@ -331,7 +331,7 @@ namespace Microsoft.AspNet.StaticFiles ApplyResponseHeaders(Constants.Status200Ok); string physicalPath = _fileInfo.PhysicalPath; - IHttpSendFile sendFile = _context.GetFeature(); + var sendFile = _context.GetFeature(); if (sendFile != null && !string.IsNullOrEmpty(physicalPath)) { await sendFile.SendFileAsync(physicalPath, 0, _length, _request.CallCanceled); @@ -377,7 +377,7 @@ namespace Microsoft.AspNet.StaticFiles ApplyResponseHeaders(Constants.Status206PartialContent); string physicalPath = _fileInfo.PhysicalPath; - IHttpSendFile sendFile = _context.GetFeature(); + var sendFile = _context.GetFeature(); if (sendFile != null && !string.IsNullOrEmpty(physicalPath)) { await sendFile.SendFileAsync(physicalPath, start, length, _request.CallCanceled);