12 implementations of IHttpResponseFeature
Microsoft.AspNetCore.Hosting.Tests (1)
WebHostTests.cs (1)
1368private class StubFeatures : IHttpRequestFeature, IHttpResponseFeature, IHeaderDictionary
Microsoft.AspNetCore.Http (1)
Features\HttpResponseFeature.cs (1)
9public class HttpResponseFeature : IHttpResponseFeature
Microsoft.AspNetCore.Http.Extensions.Tests (2)
RequestDelegateFactoryTests.cs (1)
3712private class TestHttpResponseFeature : IHttpResponseFeature, IHttpResponseBodyFeature
ResponseExtensionTests.cs (1)
51private class StartedResponseFeature : IHttpResponseFeature
Microsoft.AspNetCore.Http.Tests (3)
ApplicationBuilderTests.cs (1)
168private class TestHttpResponseFeature : IHttpResponseFeature
DefaultHttpContextTests.cs (1)
426private class TestHttpResponseFeature : IHttpResponseFeature
Internal\DefaultHttpResponseTests.cs (1)
191public class ResponseFeature : IHttpResponseFeature
Microsoft.AspNetCore.Owin (1)
OwinFeatureCollection.cs (1)
26IHttpResponseFeature,
Microsoft.AspNetCore.Server.HttpSys (1)
RequestProcessing\RequestContext.FeatureCollection.cs (1)
23IHttpResponseFeature,
Microsoft.AspNetCore.Server.IIS (1)
Core\IISHttpContext.FeatureCollection.cs (1)
27IHttpResponseFeature,
Microsoft.AspNetCore.Server.Kestrel.Core (1)
Internal\Http\HttpProtocol.Generated.cs (1)
23IHttpResponseFeature,
Microsoft.AspNetCore.TestHost (1)
ResponseFeature.cs (1)
10internal sealed class ResponseFeature : IHttpResponseFeature, IHttpResponseBodyFeature
182 references to IHttpResponseFeature
InMemory.FunctionalTests (2)
ResponseTests.cs (2)
2887var responseFeature = httpContext.Features.Get<IHttpResponseFeature>();
InProcessWebSite (7)
src\Servers\IIS\IIS\test\testassets\InProcessWebSite\Startup.cs (7)
336Assert.Null(ctx.Features.Get<IHttpResponseFeature>().ReasonPhrase); 337ctx.Features.Get<IHttpResponseFeature>().ReasonPhrase = "Set Response"; 338Assert.Equal("Set Response", ctx.Features.Get<IHttpResponseFeature>().ReasonPhrase); 342ctx.Features.Get<IHttpResponseFeature>().Headers = headers; 343Assert.Same(headers, ctx.Features.Get<IHttpResponseFeature>().Headers); 392var feature = ctx.Features.Get<IHttpResponseFeature>();
Microsoft.AspNetCore.Antiforgery.Test (1)
DefaultAntiforgeryTest.cs (1)
1265context.HttpContext.Features.Set<IHttpResponseFeature>(testResponse);
Microsoft.AspNetCore.Components.Endpoints.Tests (2)
EndpointHtmlRendererTest.cs (1)
763var responseMock = new Mock<IHttpResponseFeature>();
RazorComponentResultTest.cs (1)
241var responseMock = new Mock<IHttpResponseFeature>();
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (6)
Latency\AddServerTimingHeaderMiddlewareTests.cs (1)
39context.Features.Set<IHttpResponseFeature>(fakeHttpResponseFeature);
Latency\RequestLatencyTelemetryMiddlewareTests.cs (5)
39httpContextMock.Features.Set<IHttpResponseFeature>(fakeHttpResponseFeature); 69httpContextMock.Features.Set<IHttpResponseFeature>(fakeHttpResponseFeature); 97httpContextMock.Features.Set<IHttpResponseFeature>(fakeHttpResponseFeature); 128httpContextMock.Features.Set<IHttpResponseFeature>(fakeHttpResponseFeature); 218var feature = new Mock<IHttpResponseFeature>();
Microsoft.AspNetCore.Diagnostics.Tests (1)
ExceptionHandlerMiddlewareTest.cs (1)
255httpContext.Features.Set<IHttpResponseFeature>(new TestResponseFeature());
Microsoft.AspNetCore.Hosting.Tests (2)
HostingApplicationDiagnosticsTests.cs (1)
1097features.Set<IHttpResponseFeature>(new HttpResponseFeature());
WebHostTests.cs (1)
1243features.Set<IHttpResponseFeature>(stub);
Microsoft.AspNetCore.Http (12)
DefaultHttpContext.cs (1)
55Features.Set<IHttpResponseFeature>(new HttpResponseFeature());
Features\DefaultConnectionLifetimeNotificationFeature.cs (2)
13private readonly IHttpResponseFeature? _httpResponseFeature; 19public DefaultConnectionLifetimeNotificationFeature(IHttpResponseFeature? httpResponseFeature)
Features\HttpResponseFeature.cs (1)
7/// Default implementation for <see cref="IHttpResponseFeature"/>.
Features\ResponseCookiesFeature.cs (2)
22/// <see cref="IResponseCookiesFeature"/> and the <see cref="IHttpResponseFeature"/>. 34/// <see cref="IResponseCookiesFeature"/> and the <see cref="IHttpResponseFeature"/>.
Internal\DefaultConnectionInfo.cs (1)
16private static readonly Func<IFeatureCollection, IConnectionLifetimeNotificationFeature> _newConnectionLifetime = f => new DefaultConnectionLifetimeNotificationFeature(f.Get<IHttpResponseFeature>());
Internal\DefaultHttpResponse.cs (3)
17private static readonly Func<IFeatureCollection, IHttpResponseFeature?> _nullResponseFeature = f => null; 45private IHttpResponseFeature HttpResponseFeature => 175public IHttpResponseFeature? Response;
Internal\ResponseCookies.cs (1)
26Headers = _features.GetRequiredFeature<IHttpResponseFeature>().Headers;
src\Shared\Debugger\HttpContextDebugFormatter.cs (1)
86return response.HttpContext.Features.Get<IHttpResponseFeature>()?.ReasonPhrase ?? reasonPhrase;
Microsoft.AspNetCore.Http.Abstractions (1)
src\Shared\Debugger\HttpContextDebugFormatter.cs (1)
86return response.HttpContext.Features.Get<IHttpResponseFeature>()?.ReasonPhrase ?? reasonPhrase;
Microsoft.AspNetCore.Http.Connections (1)
Internal\HttpConnectionDispatcher.cs (1)
750features.Set<IHttpResponseFeature>(responseFeature);
Microsoft.AspNetCore.Http.Connections.Tests (9)
HttpConnectionDispatcherTests.cs (9)
262context.Features.Set<IHttpResponseFeature>(new ResponseFeature()); 300context.Features.Set<IHttpResponseFeature>(new ResponseFeature()); 853context.Features.Set<IHttpResponseFeature>(new ResponseFeature()); 2265context.Features.Set<IHttpResponseFeature>(new ResponseFeature()); 2291context.Features.Set<IHttpResponseFeature>(new ResponseFeature()); 2320context.Features.Set<IHttpResponseFeature>(new ResponseFeature()); 2349context.Features.Set<IHttpResponseFeature>(new ResponseFeature()); 3691context.Features.Set<IHttpResponseFeature>(new ResponseFeature()); 3733context.Features.Set<IHttpResponseFeature>(new ResponseFeature());
Microsoft.AspNetCore.Http.Extensions (1)
ResponseExtensions.cs (1)
27response.HttpContext.Features.GetRequiredFeature<IHttpResponseFeature>().ReasonPhrase = null;
Microsoft.AspNetCore.Http.Extensions.Tests (2)
RequestDelegateFactoryTests.cs (1)
3265[typeof(IHttpResponseFeature)] = responseFeature,
ResponseExtensionTests.cs (1)
29context.Features.Set<IHttpResponseFeature>(new StartedResponseFeature());
Microsoft.AspNetCore.Http.Features (2)
IHttpBodyControlFeature.cs (2)
7/// Controls the IO behavior for the <see cref="IHttpRequestFeature.Body"/> and <see cref="IHttpResponseFeature.Body"/> 12/// Gets or sets a value that controls whether synchronous IO is allowed for the <see cref="IHttpRequestFeature.Body"/> and <see cref="IHttpResponseFeature.Body"/>
Microsoft.AspNetCore.Http.Tests (27)
ApplicationBuilderTests.cs (1)
33httpContext.Features.Set<IHttpResponseFeature>(responseFeature);
DefaultHttpContextTests.cs (4)
154features.Set<IHttpResponseFeature>(new HttpResponseFeature()); 174newFeatures.Set<IHttpResponseFeature>(new HttpResponseFeature()); 216context.Features.Set<IHttpResponseFeature>(responseFeature); 243context.Features.Set<IHttpResponseFeature>(responseFeature);
Features\FormFeatureTests.cs (15)
16context.Features.Set<IHttpResponseFeature>(responseFeature); 54context.Features.Set<IHttpResponseFeature>(responseFeature); 89context.Features.Set<IHttpResponseFeature>(responseFeature); 204context.Features.Set<IHttpResponseFeature>(responseFeature); 239context.Features.Set<IHttpResponseFeature>(responseFeature); 276context.Features.Set<IHttpResponseFeature>(responseFeature); 324context.Features.Set<IHttpResponseFeature>(responseFeature); 361context.Features.Set<IHttpResponseFeature>(responseFeature); 409context.Features.Set<IHttpResponseFeature>(responseFeature); 461context.Features.Set<IHttpResponseFeature>(responseFeature); 485context.Features.Set<IHttpResponseFeature>(responseFeature); 509context.Features.Set<IHttpResponseFeature>(responseFeature); 533context.Features.Set<IHttpResponseFeature>(responseFeature); 558context.Features.Set<IHttpResponseFeature>(responseFeature); 601context.Features.Set<IHttpResponseFeature>(responseFeature);
Internal\DefaultHttpResponseTests.cs (6)
80var responseMock = new Mock<IHttpResponseFeature>(); 113var responseMock = new Mock<IHttpResponseFeature>(); 133var responseMock = new Mock<IHttpResponseFeature>(); 152var responseMock = new Mock<IHttpResponseFeature>(); 179features.Set<IHttpResponseFeature>(response); 241context.Features.Get<IHttpResponseFeature>().Headers = headers;
ResponseCookiesTest.cs (1)
20features.Set<IHttpResponseFeature>(responseFeature);
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (10)
XmlDataContractSerializerInputFormatterTest.cs (5)
148httpContext.Features.Set<IHttpResponseFeature>(new TestResponseFeature()); 212httpContext.Features.Set<IHttpResponseFeature>(new TestResponseFeature()); 247httpContext.Features.Set<IHttpResponseFeature>(new TestResponseFeature()); 279httpContext.Features.Set<IHttpResponseFeature>(new TestResponseFeature()); 338httpContext.Features.Set<IHttpResponseFeature>(new TestResponseFeature());
XmlSerializerInputFormatterTest.cs (5)
53httpContext.Features.Set<IHttpResponseFeature>(new TestResponseFeature()); 90httpContext.Features.Set<IHttpResponseFeature>(new TestResponseFeature()); 126httpContext.Features.Set<IHttpResponseFeature>(new TestResponseFeature()); 162httpContext.Features.Set<IHttpResponseFeature>(new TestResponseFeature()); 204httpContext.Features.Set<IHttpResponseFeature>(new TestResponseFeature());
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (7)
NewtonsoftJsonInputFormatterTest.cs (5)
40httpContext.Features.Set<IHttpResponseFeature>(new TestResponseFeature()); 76httpContext.Features.Set<IHttpResponseFeature>(new TestResponseFeature()); 112httpContext.Features.Set<IHttpResponseFeature>(new TestResponseFeature()); 504httpContext.Features.Set<IHttpResponseFeature>(new TestResponseFeature()); 547httpContext.Features.Set<IHttpResponseFeature>(new TestResponseFeature());
NewtonsoftJsonPatchInputFormatterTest.cs (2)
39httpContext.Features.Set<IHttpResponseFeature>(new TestResponseFeature()); 76httpContext.Features.Set<IHttpResponseFeature>(new TestResponseFeature());
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (3)
Filters\SaveTempDataFilterTest.cs (3)
51var responseFeature = new Mock<IHttpResponseFeature>(MockBehavior.Strict); 357private HttpContext GetHttpContext(IHttpResponseFeature responseFeature = null) 364httpContext.Features.Set<IHttpResponseFeature>(responseFeature);
Microsoft.AspNetCore.Owin (14)
OwinEnvironment.cs (6)
44if (context.Features.Get<IHttpResponseFeature>() == null) 46throw new ArgumentException("Missing required feature: " + nameof(IHttpResponseFeature) + ".", nameof(context)); 63{ OwinConstants.ResponseStatusCode, new FeatureMap<IHttpResponseFeature>(feature => feature.StatusCode, () => 200, (feature, value) => feature.StatusCode = Convert.ToInt32(value, CultureInfo.InvariantCulture)) }, 64{ OwinConstants.ResponseReasonPhrase, new FeatureMap<IHttpResponseFeature>(feature => feature.ReasonPhrase, (feature, value) => feature.ReasonPhrase = Convert.ToString(value, CultureInfo.InvariantCulture)) }, 65{ OwinConstants.ResponseHeaders, new FeatureMap<IHttpResponseFeature>(feature => Utilities.MakeDictionaryStringArray(feature.Headers), (feature, value) => feature.Headers = Utilities.MakeHeaderDictionary((IDictionary<string, string[]>)value)) }, 67{ OwinConstants.CommonKeys.OnSendingHeaders, new FeatureMap<IHttpResponseFeature>(
OwinFeatureCollection.cs (8)
135int IHttpResponseFeature.StatusCode 141string IHttpResponseFeature.ReasonPhrase 147IHeaderDictionary IHttpResponseFeature.Headers 153Stream IHttpResponseFeature.Body 177bool IHttpResponseFeature.HasStarted 182void IHttpResponseFeature.OnStarting(Func<object, Task> callback, object state) 194void IHttpResponseFeature.OnCompleted(Func<object, Task> callback, object state) 401yield return new KeyValuePair<Type, object>(typeof(IHttpResponseFeature), this);
Microsoft.AspNetCore.RequestDecompression.Microbenchmarks (1)
RequestDecompressionMiddlewareBenchmark.cs (1)
57features.Set<IHttpResponseFeature>(new HttpResponseFeature());
Microsoft.AspNetCore.ResponseCaching.Microbenchmarks (1)
ResponseCachingBenchmark.cs (1)
88features.Set<IHttpResponseFeature>(new HttpResponseFeature());
Microsoft.AspNetCore.ResponseCaching.Tests (1)
ResponseCachingMiddlewareTests.cs (1)
919context.Features.Set<IHttpResponseFeature>(new FakeResponseFeature());
Microsoft.AspNetCore.Rewrite (1)
UrlActions\CustomResponseAction.cs (1)
29context.HttpContext.Features.GetRequiredFeature<IHttpResponseFeature>().ReasonPhrase = StatusReason;
Microsoft.AspNetCore.Server.HttpSys (8)
RequestProcessing\RequestContext.FeatureCollection.cs (7)
424Stream IHttpResponseFeature.Body 445IHeaderDictionary IHttpResponseFeature.Headers 451bool IHttpResponseFeature.HasStarted => _responseStarted; 453void IHttpResponseFeature.OnStarting(Func<object, Task> callback, object state) 464void IHttpResponseFeature.OnCompleted(Func<object, Task> callback, object state) 475string? IHttpResponseFeature.ReasonPhrase 481int IHttpResponseFeature.StatusCode
StandardFeatureCollection.cs (1)
19{ typeof(IHttpResponseFeature), _identityFunc },
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (11)
ResponseHeaderTests.cs (10)
46var responseInfo = httpContext.Features.Get<IHttpResponseFeature>(); 72var responseInfo = httpContext.Features.Get<IHttpResponseFeature>(); 97var responseInfo = httpContext.Features.Get<IHttpResponseFeature>(); 122var responseInfo = httpContext.Features.Get<IHttpResponseFeature>(); 143var responseInfo = httpContext.Features.Get<IHttpResponseFeature>();
ResponseTests.cs (1)
67httpContext.Features.Get<IHttpResponseFeature>().ReasonPhrase = "CustomReasonPhrase"; // TODO?
Microsoft.AspNetCore.Server.IIS (8)
Core\IISHttpContext.FeatureCollection.cs (7)
164int IHttpResponseFeature.StatusCode 170string? IHttpResponseFeature.ReasonPhrase 176IHeaderDictionary IHttpResponseFeature.Headers 182Stream IHttpResponseFeature.Body 188bool IHttpResponseFeature.HasStarted => HasResponseStarted; 327void IHttpResponseFeature.OnStarting(Func<object, Task> callback, object state) 332void IHttpResponseFeature.OnCompleted(Func<object, Task> callback, object state)
Core\IISHttpContext.Features.cs (1)
10private static readonly Type IHttpResponseFeatureType = typeof(global::Microsoft.AspNetCore.Http.Features.IHttpResponseFeature);
Microsoft.AspNetCore.Server.Kestrel.Core (16)
Internal\Http\HttpProtocol.FeatureCollection.cs (7)
124int IHttpResponseFeature.StatusCode 130string? IHttpResponseFeature.ReasonPhrase 136IHeaderDictionary IHttpResponseFeature.Headers 148bool IHttpResponseFeature.HasStarted => HasResponseStarted; 222Stream IHttpResponseFeature.Body 249void IHttpResponseFeature.OnStarting(Func<object, Task> callback, object state) 254void IHttpResponseFeature.OnCompleted(Func<object, Task> callback, object state)
Internal\Http\HttpProtocol.Generated.cs (9)
42internal protected IHttpResponseFeature? _currentIHttpResponseFeature; 196else if (key == typeof(IHttpResponseFeature)) 348else if (key == typeof(IHttpResponseFeature)) 350_currentIHttpResponseFeature = (IHttpResponseFeature?)value; 502else if (typeof(TFeature) == typeof(IHttpResponseFeature)) 504feature = Unsafe.As<IHttpResponseFeature?, TFeature?>(ref _currentIHttpResponseFeature); 662else if (typeof(TFeature) == typeof(IHttpResponseFeature)) 664_currentIHttpResponseFeature = Unsafe.As<TFeature?, IHttpResponseFeature?>(ref feature); 812yield return new KeyValuePair<Type, object>(typeof(IHttpResponseFeature), _currentIHttpResponseFeature);
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (10)
Http1\Http1ConnectionTests.cs (6)
304Assert.Throws<InvalidOperationException>(() => ((IHttpResponseFeature)_http1Connection).StatusCode = StatusCodes.Status404NotFound); 315Assert.Throws<InvalidOperationException>(() => ((IHttpResponseFeature)_http1Connection).ReasonPhrase = "Reason phrase"); 325Assert.Throws<InvalidOperationException>(() => ((IHttpResponseFeature)_http1Connection).OnStarting(_ => Task.CompletedTask, null)); 588((IHttpResponseFeature)_http1Connection).StatusCode = StatusCodes.Status304NotModified; 599((IHttpResponseFeature)_http1Connection).StatusCode = StatusCodes.Status304NotModified; 646((IHttpResponseFeature)_http1Connection).StatusCode = StatusCodes.Status304NotModified;
Http1\Http1HttpProtocolFeatureCollectionTests.cs (4)
106_collection[typeof(IHttpResponseFeature)] = CreateHttp1Connection(); 136_collection.Set<IHttpResponseFeature>(CreateHttp1Connection()); 184Assert.Same(_collection.Get<IHttpResponseFeature>(), _collection[typeof(IHttpResponseFeature)]);
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (2)
HttpProtocolFeatureCollection.cs (2)
33public IHttpResponseFeature Get_IHttpResponseFeature() 35return _collection.Get<IHttpResponseFeature>();
Microsoft.AspNetCore.TestHost (5)
ClientHandler.cs (1)
213response.ReasonPhrase = httpContext.Features.GetRequiredFeature<IHttpResponseFeature>().ReasonPhrase;
HttpContextBuilder.cs (4)
52_httpContext.Features.Set<IHttpResponseFeature>(_responseFeature); 237var serverResponseFeature = _httpContext.Features.GetRequiredFeature<IHttpResponseFeature>(); 246newFeatures.Set<IHttpResponseFeature>(clientResponseFeature);
Microsoft.AspNetCore.TestHost.Tests (8)
ClientHandlerTests.cs (7)
33Assert.NotNull(features.Get<IHttpResponseFeature>().Headers); 35Assert.Equal(200, features.Get<IHttpResponseFeature>().StatusCode); 36Assert.Null(features.Get<IHttpResponseFeature>().ReasonPhrase); 61Assert.Null(context.Features.Get<IHttpResponseFeature>().ReasonPhrase); 84Assert.NotNull(features.Get<IHttpResponseFeature>().Headers); 86Assert.Equal(200, features.Get<IHttpResponseFeature>().StatusCode); 87Assert.Null(features.Get<IHttpResponseFeature>().ReasonPhrase);
HttpContextBuilderTests.cs (1)
44Assert.Null(context.Features.Get<IHttpResponseFeature>().ReasonPhrase);