From 916cb32e7ea6ccdda4dda716e2c1b444256e7e43 Mon Sep 17 00:00:00 2001 From: Chris R Date: Mon, 31 Aug 2015 09:26:50 -0700 Subject: [PATCH] Use the new HttpContext.Features API. --- src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs | 4 ++-- src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs index 743d35b634..486d93eaf7 100644 --- a/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs +++ b/src/Microsoft.AspNet.StaticFiles/SendFileMiddleware.cs @@ -38,9 +38,9 @@ namespace Microsoft.AspNet.StaticFiles public Task Invoke(HttpContext context) { // Check if there is a SendFile feature already present - if (context.GetFeature() == null) + if (context.Features.Get() == null) { - context.SetFeature(new SendFileWrapper(context.Response.Body, _logger)); + context.Features.Set(new SendFileWrapper(context.Response.Body, _logger)); } return _next(context); diff --git a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs index 2a8f978287..9604a10b31 100644 --- a/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs +++ b/src/Microsoft.AspNet.StaticFiles/StaticFileContext.cs @@ -324,7 +324,7 @@ namespace Microsoft.AspNet.StaticFiles ApplyResponseHeaders(Constants.Status200Ok); string physicalPath = _fileInfo.PhysicalPath; - var sendFile = _context.GetFeature(); + var sendFile = _context.Features.Get(); if (sendFile != null && !string.IsNullOrEmpty(physicalPath)) { await sendFile.SendFileAsync(physicalPath, 0, _length, _context.RequestAborted); @@ -371,7 +371,7 @@ namespace Microsoft.AspNet.StaticFiles ApplyResponseHeaders(Constants.Status206PartialContent); string physicalPath = _fileInfo.PhysicalPath; - var sendFile = _context.GetFeature(); + var sendFile = _context.Features.Get(); if (sendFile != null && !string.IsNullOrEmpty(physicalPath)) { if (_logger.IsEnabled(LogLevel.Verbose))