17 implementations of IHttpResponseBodyFeature
Microsoft.AspNetCore.Http (1)
StreamResponseBodyFeature.cs (1)
12public class StreamResponseBodyFeature : IHttpResponseBodyFeature
Microsoft.AspNetCore.Http.Extensions.Tests (2)
RequestDelegateFactoryTests.cs (1)
3712private class TestHttpResponseFeature : IHttpResponseFeature, IHttpResponseBodyFeature
SendFileResponseExtensionsTests.cs (1)
102private class FakeResponseBodyFeature : IHttpResponseBodyFeature
Microsoft.AspNetCore.Http.Results.Tests (2)
src\Shared\ResultsTests\PhysicalFileResultTestBase.cs (1)
422private sealed class TestSendFileFeature : IHttpResponseBodyFeature
src\Shared\ResultsTests\VirtualFileResultTestBase.cs (1)
525private sealed class TestSendFileFeature : IHttpResponseBodyFeature
Microsoft.AspNetCore.HttpLogging (1)
ResponseBufferingStream.cs (1)
12internal sealed class ResponseBufferingStream : BufferingStream, IHttpResponseBodyFeature
Microsoft.AspNetCore.Mvc.Core.Test (2)
src\Shared\ResultsTests\PhysicalFileResultTestBase.cs (1)
422private sealed class TestSendFileFeature : IHttpResponseBodyFeature
src\Shared\ResultsTests\VirtualFileResultTestBase.cs (1)
525private sealed class TestSendFileFeature : IHttpResponseBodyFeature
Microsoft.AspNetCore.Owin (1)
OwinFeatureCollection.cs (1)
27IHttpResponseBodyFeature,
Microsoft.AspNetCore.ResponseCaching.Microbenchmarks (1)
ResponseCachingBenchmark.cs (1)
112private sealed class PipeResponseBodyFeature : IHttpResponseBodyFeature
Microsoft.AspNetCore.ResponseCompression (1)
ResponseCompressionBody.cs (1)
15internal sealed class ResponseCompressionBody : Stream, IHttpResponseBodyFeature, IHttpsCompressionFeature
Microsoft.AspNetCore.ResponseCompression.Tests (1)
ResponseCompressionMiddlewareTest.cs (1)
1344private class FakeSendFileFeature : IHttpResponseBodyFeature
Microsoft.AspNetCore.Server.HttpSys (1)
RequestProcessing\RequestContext.FeatureCollection.cs (1)
24IHttpResponseBodyFeature,
Microsoft.AspNetCore.Server.IIS (1)
Core\IISHttpContext.FeatureCollection.cs (1)
28IHttpResponseBodyFeature,
Microsoft.AspNetCore.Server.Kestrel.Core (1)
Internal\Http\HttpProtocol.Generated.cs (1)
24IHttpResponseBodyFeature,
Microsoft.AspNetCore.StaticAssets (1)
Development\StaticAssetDevelopmentRuntimeHandler.cs (1)
66internal sealed class RuntimeStaticAssetResponseBodyFeature : IHttpResponseBodyFeature
Microsoft.AspNetCore.TestHost (1)
ResponseFeature.cs (1)
10internal sealed class ResponseFeature : IHttpResponseFeature, IHttpResponseBodyFeature
184 references to IHttpResponseBodyFeature
Microsoft.AspNetCore.Components.Endpoints (2)
RazorComponentEndpointInvoker.cs (2)
126var bufferingFeature = context.Features.GetRequiredFeature<IHttpResponseBodyFeature>();
Microsoft.AspNetCore.Http (10)
DefaultHttpContext.cs (1)
56Features.Set<IHttpResponseBodyFeature>(new StreamResponseBodyFeature(Stream.Null));
Internal\DefaultHttpResponse.cs (6)
18private static readonly Func<IFeatureCollection, IHttpResponseBodyFeature?> _nullResponseBodyFeature = f => null; 48private IHttpResponseBodyFeature HttpResponseBodyFeature => 72var otherFeature = _features.Collection.GetRequiredFeature<IHttpResponseBodyFeature>(); 83_features.Collection.Set<IHttpResponseBodyFeature>(new StreamResponseBodyFeature(value, otherFeature)); 176public IHttpResponseBodyFeature? ResponseBody;
StreamResponseBodyFeature.cs (3)
10/// An implementation of <see cref="IHttpResponseBodyFeature"/> that aproximates all of the APIs over the given Stream. 33public StreamResponseBodyFeature(Stream stream, IHttpResponseBodyFeature? priorFeature) 47public IHttpResponseBodyFeature? PriorFeature { get; }
Microsoft.AspNetCore.Http.Connections (3)
Internal\HttpConnectionDispatcher.cs (1)
751features.Set<IHttpResponseBodyFeature>(new StreamResponseBodyFeature(Stream.Null));
Internal\Transports\ServerSentEventsServerTransport.cs (2)
38var bufferingFeature = context.Features.GetRequiredFeature<IHttpResponseBodyFeature>();
Microsoft.AspNetCore.Http.Connections.Tests (1)
ServerSentEventsTests.cs (1)
50context.Features.Set<IHttpResponseBodyFeature>(feature);
Microsoft.AspNetCore.Http.Extensions (2)
SendFileResponseExtensions.cs (2)
116var sendFile = response.HttpContext.Features.GetRequiredFeature<IHttpResponseBodyFeature>();
Microsoft.AspNetCore.Http.Extensions.Tests (4)
RequestDelegateFactoryTests.cs (1)
3266[typeof(IHttpResponseBodyFeature)] = responseFeature,
SendFileResponseExtensionsTests.cs (3)
24context.Features.Set<IHttpResponseBodyFeature>(fakeFeature); 66context.Features.Set<IHttpResponseBodyFeature>(fakeFeature); 92context.Features.Set<IHttpResponseBodyFeature>(fakeFeature);
Microsoft.AspNetCore.Http.Results.Tests (21)
src\Shared\ResultsTests\PhysicalFileResultTestBase.cs (9)
41httpContext.Features.Set<IHttpResponseBodyFeature>(sendFile); 73httpContext.Features.Set<IHttpResponseBodyFeature>(sendFile); 105httpContext.Features.Set<IHttpResponseBodyFeature>(sendFile); 132httpContext.Features.Set<IHttpResponseBodyFeature>(sendFile); 161httpContext.Features.Set<IHttpResponseBodyFeature>(sendFile); 271var sendFileMock = new Mock<IHttpResponseBodyFeature>(); 297httpContext.Features.Set<IHttpResponseBodyFeature>(sendFile); 330httpContext.Features.Set<IHttpResponseBodyFeature>(sendFile); 351httpContext.Features.Set<IHttpResponseBodyFeature>(sendFile);
src\Shared\ResultsTests\VirtualFileResultTestBase.cs (12)
52httpContext.Features.Set<IHttpResponseBodyFeature>(sendFileFeature); 89httpContext.Features.Set<IHttpResponseBodyFeature>(sendFileFeature); 126httpContext.Features.Set<IHttpResponseBodyFeature>(sendFileFeature); 159httpContext.Features.Set<IHttpResponseBodyFeature>(sendFileFeature); 195httpContext.Features.Set<IHttpResponseBodyFeature>(sendFileFeature); 265httpContext.Features.Set<IHttpResponseBodyFeature>(sendFileFeature); 296httpContext.Features.Set<IHttpResponseBodyFeature>(sendFileFeature); 328httpContext.Features.Set<IHttpResponseBodyFeature>(sendFile); 365httpContext.Features.Set<IHttpResponseBodyFeature>(sendFileFeature); 383httpContext.Features.Set<IHttpResponseBodyFeature>(sendFileFeature); 405httpContext.Features.Set<IHttpResponseBodyFeature>(sendFileFeature); 428httpContext.Features.Set<IHttpResponseBodyFeature>(sendFileFeature);
Microsoft.AspNetCore.Http.Tests (10)
DefaultHttpContextTests.cs (2)
155features.Set<IHttpResponseBodyFeature>(new StreamResponseBodyFeature(Stream.Null)); 175newFeatures.Set<IHttpResponseBodyFeature>(new StreamResponseBodyFeature(Stream.Null));
Features\StreamResponseBodyFeatureTests.cs (1)
73public InnerDisableBufferingFeature(Stream stream, IHttpResponseBodyFeature priorFeature)
Internal\DefaultHttpResponseTests.cs (7)
76var responseBodyMock = new Mock<IHttpResponseBodyFeature>(); 86Assert.Same(responseBodyMock.Object, context.Features.Get<IHttpResponseBodyFeature>()); 91Assert.NotSame(responseBodyMock.Object, context.Features.Get<IHttpResponseBodyFeature>()); 96Assert.Same(responseBodyMock.Object, context.Features.Get<IHttpResponseBodyFeature>()); 109var mock = new Mock<IHttpResponseBodyFeature>(); 128var mock = new Mock<IHttpResponseBodyFeature>(); 148var startMock = new Mock<IHttpResponseBodyFeature>();
Microsoft.AspNetCore.HttpLogging (6)
HttpLoggingFields.cs (1)
98/// or when <see cref="IHttpResponseBodyFeature.StartAsync(System.Threading.CancellationToken)"/>
HttpLoggingMiddleware.cs (3)
179IHttpResponseBodyFeature? originalBodyFeature = null; 204originalBodyFeature = context.Features.Get<IHttpResponseBodyFeature>()!; 210context.Features.Set<IHttpResponseBodyFeature>(responseBufferingStream);
ResponseBufferingStream.cs (2)
14private readonly IHttpResponseBodyFeature _innerBodyFeature; 26internal ResponseBufferingStream(IHttpResponseBodyFeature innerBodyFeature,
Microsoft.AspNetCore.Mvc.Core.Test (21)
src\Shared\ResultsTests\PhysicalFileResultTestBase.cs (9)
41httpContext.Features.Set<IHttpResponseBodyFeature>(sendFile); 73httpContext.Features.Set<IHttpResponseBodyFeature>(sendFile); 105httpContext.Features.Set<IHttpResponseBodyFeature>(sendFile); 132httpContext.Features.Set<IHttpResponseBodyFeature>(sendFile); 161httpContext.Features.Set<IHttpResponseBodyFeature>(sendFile); 271var sendFileMock = new Mock<IHttpResponseBodyFeature>(); 297httpContext.Features.Set<IHttpResponseBodyFeature>(sendFile); 330httpContext.Features.Set<IHttpResponseBodyFeature>(sendFile); 351httpContext.Features.Set<IHttpResponseBodyFeature>(sendFile);
src\Shared\ResultsTests\VirtualFileResultTestBase.cs (12)
52httpContext.Features.Set<IHttpResponseBodyFeature>(sendFileFeature); 89httpContext.Features.Set<IHttpResponseBodyFeature>(sendFileFeature); 126httpContext.Features.Set<IHttpResponseBodyFeature>(sendFileFeature); 159httpContext.Features.Set<IHttpResponseBodyFeature>(sendFileFeature); 195httpContext.Features.Set<IHttpResponseBodyFeature>(sendFileFeature); 265httpContext.Features.Set<IHttpResponseBodyFeature>(sendFileFeature); 296httpContext.Features.Set<IHttpResponseBodyFeature>(sendFileFeature); 328httpContext.Features.Set<IHttpResponseBodyFeature>(sendFile); 365httpContext.Features.Set<IHttpResponseBodyFeature>(sendFileFeature); 383httpContext.Features.Set<IHttpResponseBodyFeature>(sendFileFeature); 405httpContext.Features.Set<IHttpResponseBodyFeature>(sendFileFeature); 428httpContext.Features.Set<IHttpResponseBodyFeature>(sendFileFeature);
Microsoft.AspNetCore.Owin (9)
OwinEnvironment.cs (2)
66{ OwinConstants.ResponseBody, new FeatureMap<IHttpResponseBodyFeature>(feature => feature.Stream, () => Stream.Null, (feature, value) => context.Response.Body = (Stream)value) }, // DefaultHttpResponse.Body.Set has built in logic to handle replacing the feature. 90{ OwinConstants.SendFiles.SendAsync, new FeatureMap<IHttpResponseBodyFeature>(feature => new SendFileFunc(feature.SendFileAsync)) },
OwinFeatureCollection.cs (7)
159Stream IHttpResponseBodyFeature.Stream 164PipeWriter IHttpResponseBodyFeature.Writer 229Task IHttpResponseBodyFeature.SendFileAsync(string path, long offset, long? length, CancellationToken cancellation) 402yield return new KeyValuePair<Type, object>(typeof(IHttpResponseBodyFeature), this); 420void IHttpResponseBodyFeature.DisableBuffering() 424async Task IHttpResponseBodyFeature.StartAsync(CancellationToken cancellationToken) 435Task IHttpResponseBodyFeature.CompleteAsync()
Microsoft.AspNetCore.ResponseCaching.Microbenchmarks (1)
ResponseCachingBenchmark.cs (1)
89features.Set<IHttpResponseBodyFeature>(new PipeResponseBodyFeature(pipe.Writer));
Microsoft.AspNetCore.ResponseCompression (5)
ResponseCompressionBody.cs (2)
19private readonly IHttpResponseBodyFeature _innerBodyFeature; 31IHttpResponseBodyFeature innerBodyFeature)
ResponseCompressionMiddleware.cs (3)
48var originalBodyFeature = context.Features.Get<IHttpResponseBodyFeature>(); 54context.Features.Set<IHttpResponseBodyFeature>(compressionBody);
Microsoft.AspNetCore.ResponseCompression.Tests (17)
ResponseCompressionMiddlewareTest.cs (17)
850context.Features.Get<IHttpResponseBodyFeature>().DisableBuffering(); 920context.Features.Get<IHttpResponseBodyFeature>().DisableBuffering(); 984context.Features.Get<IHttpResponseBodyFeature>().DisableBuffering(); 1040fakeSendFile = new FakeSendFileFeature(context.Features.Get<IHttpResponseBodyFeature>()); 1041context.Features.Set<IHttpResponseBodyFeature>(fakeSendFile); 1050var sendFile = context.Features.Get<IHttpResponseBodyFeature>(); 1090fakeSendFile = new FakeSendFileFeature(context.Features.Get<IHttpResponseBodyFeature>()); 1091context.Features.Set<IHttpResponseBodyFeature>(fakeSendFile); 1100var sendFile = context.Features.Get<IHttpResponseBodyFeature>(); 1140fakeSendFile = new FakeSendFileFeature(context.Features.Get<IHttpResponseBodyFeature>()); 1141context.Features.Set<IHttpResponseBodyFeature>(fakeSendFile); 1149var feature = context.Features.Get<IHttpResponseBodyFeature>(); 1346public FakeSendFileFeature(IHttpResponseBodyFeature innerFeature) 1351public IHttpResponseBodyFeature InnerFeature { get; }
Microsoft.AspNetCore.Server.HttpSys (7)
RequestProcessing\RequestContext.FeatureCollection.cs (6)
419void IHttpResponseBodyFeature.DisableBuffering() 430Stream IHttpResponseBodyFeature.Stream => _responseStream; 432PipeWriter IHttpResponseBodyFeature.Writer 487async Task IHttpResponseBodyFeature.SendFileAsync(string path, long offset, long? length, CancellationToken cancellation) 493Task IHttpResponseBodyFeature.StartAsync(CancellationToken cancellation) 498Task IHttpResponseBodyFeature.CompleteAsync() => CompleteAsync();
StandardFeatureCollection.cs (1)
20{ typeof(IHttpResponseBodyFeature), _identityFunc },
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (26)
ResponseSendFileTests.cs (26)
42var sendFile = httpContext.Features.Get<IHttpResponseBodyFeature>(); 67var sendFile = httpContext.Features.Get<IHttpResponseBodyFeature>(); 86var sendFile = httpContext.Features.Get<IHttpResponseBodyFeature>(); 105var sendFile = httpContext.Features.Get<IHttpResponseBodyFeature>(); 124var sendFile = httpContext.Features.Get<IHttpResponseBodyFeature>(); 144var sendFile = httpContext.Features.Get<IHttpResponseBodyFeature>(); 164var sendFile = httpContext.Features.Get<IHttpResponseBodyFeature>(); 183var sendFile = httpContext.Features.Get<IHttpResponseBodyFeature>(); 201var sendFile = httpContext.Features.Get<IHttpResponseBodyFeature>(); 220var sendFile = httpContext.Features.Get<IHttpResponseBodyFeature>(); 241var sendFile = httpContext.Features.Get<IHttpResponseBodyFeature>(); 262var sendFile = httpContext.Features.Get<IHttpResponseBodyFeature>(); 290var sendFile = httpContext.Features.Get<IHttpResponseBodyFeature>();
Microsoft.AspNetCore.Server.IIS (7)
Core\IISHttpContext.FeatureCollection.cs (6)
190Stream IHttpResponseBodyFeature.Stream => ResponseBody; 192PipeWriter IHttpResponseBodyFeature.Writer 205Task IHttpResponseBodyFeature.StartAsync(CancellationToken cancellationToken) 215Task IHttpResponseBodyFeature.SendFileAsync(string path, long offset, long? count, CancellationToken cancellation) 220Task IHttpResponseBodyFeature.CompleteAsync() 505void IHttpResponseBodyFeature.DisableBuffering()
Core\IISHttpContext.Features.cs (1)
11private static readonly Type IHttpResponseBodyFeatureType = typeof(global::Microsoft.AspNetCore.Http.Features.IHttpResponseBodyFeature);
Microsoft.AspNetCore.Server.Kestrel.Core (15)
Internal\Http\HttpProtocol.FeatureCollection.cs (6)
228PipeWriter IHttpResponseBodyFeature.Writer => ResponseBodyPipeWriter; 242Stream IHttpResponseBodyFeature.Stream => ResponseBody; 321Task IHttpResponseBodyFeature.StartAsync(CancellationToken cancellationToken) 333void IHttpResponseBodyFeature.DisableBuffering() 337Task IHttpResponseBodyFeature.SendFileAsync(string path, long offset, long? count, CancellationToken cancellation) 342Task IHttpResponseBodyFeature.CompleteAsync()
Internal\Http\HttpProtocol.Generated.cs (9)
43internal protected IHttpResponseBodyFeature? _currentIHttpResponseBodyFeature; 200else if (key == typeof(IHttpResponseBodyFeature)) 352else if (key == typeof(IHttpResponseBodyFeature)) 354_currentIHttpResponseBodyFeature = (IHttpResponseBodyFeature?)value; 506else if (typeof(TFeature) == typeof(IHttpResponseBodyFeature)) 508feature = Unsafe.As<IHttpResponseBodyFeature?, TFeature?>(ref _currentIHttpResponseBodyFeature); 666else if (typeof(TFeature) == typeof(IHttpResponseBodyFeature)) 668_currentIHttpResponseBodyFeature = Unsafe.As<TFeature?, IHttpResponseBodyFeature?>(ref feature); 816yield return new KeyValuePair<Type, object>(typeof(IHttpResponseBodyFeature), _currentIHttpResponseBodyFeature);
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (4)
Http1\Http1HttpProtocolFeatureCollectionTests.cs (4)
107_collection[typeof(IHttpResponseBodyFeature)] = CreateHttp1Connection(); 137_collection.Set<IHttpResponseBodyFeature>(CreateHttp1Connection()); 185Assert.Same(_collection.Get<IHttpResponseBodyFeature>(), _collection[typeof(IHttpResponseBodyFeature)]);
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (2)
HttpProtocolFeatureCollection.cs (2)
40public IHttpResponseBodyFeature Get_IHttpResponseBodyFeature() 42return _collection.Get<IHttpResponseBodyFeature>();
Microsoft.AspNetCore.StaticAssets (5)
Development\StaticAssetDevelopmentRuntimeHandler.cs (5)
43var originalFeature = context.Features.GetRequiredFeature<IHttpResponseBodyFeature>(); 52context.Features.Set<IHttpResponseBodyFeature>(new RuntimeStaticAssetResponseBodyFeature(originalFeature, context, asset)); 68private readonly IHttpResponseBodyFeature _original; 72public RuntimeStaticAssetResponseBodyFeature(IHttpResponseBodyFeature original, HttpContext context, StaticAssetDescriptor asset)
Microsoft.AspNetCore.StaticFiles.Tests (1)
StaticFileMiddlewareTests.cs (1)
86var mockSendFile = new Mock<IHttpResponseBodyFeature>();
Microsoft.AspNetCore.TestHost (2)
HttpContextBuilder.cs (2)
53_httpContext.Features.Set<IHttpResponseBodyFeature>(_responseFeature); 247newFeatures.Set<IHttpResponseBodyFeature>(new StreamResponseBodyFeature(_responseReaderStream));
Microsoft.AspNetCore.TestHost.Tests (2)
ClientHandlerTests.cs (2)
34Assert.NotNull(features.Get<IHttpResponseBodyFeature>().Stream); 85Assert.NotNull(features.Get<IHttpResponseBodyFeature>().Stream);
ResponseCompressionSample (1)
Startup.cs (1)
48context.Features.Get<IHttpResponseBodyFeature>().DisableBuffering();