5 implementations of IHttpUpgradeFeature
Microsoft.AspNetCore.HttpLogging (1)
UpgradeFeatureLoggingDecorator.cs (1)
9internal sealed class UpgradeFeatureLoggingDecorator : IHttpUpgradeFeature
Microsoft.AspNetCore.Server.HttpSys (1)
RequestProcessing\RequestContext.FeatureCollection.cs (1)
30IHttpUpgradeFeature,
Microsoft.AspNetCore.Server.IIS (1)
Core\IISHttpContext.FeatureCollection.cs (1)
29IHttpUpgradeFeature,
Microsoft.AspNetCore.Server.Kestrel.Core (1)
Internal\Http\HttpProtocol.Generated.cs (1)
30IHttpUpgradeFeature,
Microsoft.AspNetCore.TestHost (1)
UpgradeFeature.cs (1)
8internal sealed class UpgradeFeature : IHttpUpgradeFeature
134 references to IHttpUpgradeFeature
IISSample (1)
Startup.cs (1)
82if (context.Features.Get<IHttpUpgradeFeature>() != null)
InMemory.FunctionalTests (37)
ConnectionLimitTests.cs (2)
59var feature = context.Features.Get<IHttpUpgradeFeature>();
EventSourceTests.cs (2)
46var upgradeFeature = context.Features.Get<IHttpUpgradeFeature>();
KeepAliveTimeoutTests.cs (1)
272using (var stream = await httpContext.Features.Get<IHttpUpgradeFeature>().UpgradeAsync())
KestrelMetricsTests.cs (2)
520var upgradeFeature = context.Features.Get<IHttpUpgradeFeature>();
MaxRequestBodySizeTests.cs (2)
330var upgradeFeature = context.Features.Get<IHttpUpgradeFeature>();
RequestTests.cs (6)
184var stream = await context.Features.Get<IHttpUpgradeFeature>().UpgradeAsync(); 1357var upgradeFeature = context.Features.Get<IHttpUpgradeFeature>(); 1599var upgradeFeature = context.Features.Get<IHttpUpgradeFeature>(); 1637using (var stream = await context.Features.Get<IHttpUpgradeFeature>().UpgradeAsync())
ResponseTests.cs (1)
2377var stream = await httpContext.Features.Get<IHttpUpgradeFeature>().UpgradeAsync();
UpgradeTests.cs (21)
28var feature = context.Features.Get<IHttpUpgradeFeature>(); 73var feature = context.Features.Get<IHttpUpgradeFeature>(); 123var feature = context.Features.Get<IHttpUpgradeFeature>(); 163var feature = context.Features.Get<IHttpUpgradeFeature>(); 197var feature = context.Features.Get<IHttpUpgradeFeature>(); 232var feature = context.Features.Get<IHttpUpgradeFeature>(); 273var feature = context.Features.Get<IHttpUpgradeFeature>(); 310var feature = context.Features.Get<IHttpUpgradeFeature>(); 358var feature = context.Features.Get<IHttpUpgradeFeature>(); 397var upgradeFeature = context.Features.Get<IHttpUpgradeFeature>(); 442await context.Features.Get<IHttpUpgradeFeature>().UpgradeAsync();
InProcessWebSite (9)
src\Servers\IIS\IIS\test\testassets\InProcessWebSite\Startup.cs (1)
1106context.Response.WriteAsync(context.Features.Get<IHttpUpgradeFeature>() != null ? "Enabled" : "Disabled");
src\Servers\IIS\IIS\test\testassets\InProcessWebSite\Startup.WebSockets.cs (8)
29var upgradeFeature = context.Features.Get<IHttpUpgradeFeature>(); 39var upgradeFeature = context.Features.Get<IHttpUpgradeFeature>(); 100var upgradeFeature = context.Features.Get<IHttpUpgradeFeature>(); 144var upgradeFeature = context.Features.Get<IHttpUpgradeFeature>();
Microsoft.AspNetCore.Http.Features (1)
IHttpMaxRequestBodySizeFeature.cs (1)
14/// or that <see cref="IHttpUpgradeFeature.UpgradeAsync"/> was called.
Microsoft.AspNetCore.HttpLogging (5)
HttpLoggingMiddleware.cs (3)
182IHttpUpgradeFeature? originalUpgradeFeature = null; 190originalUpgradeFeature = context.Features.Get<IHttpUpgradeFeature>(); 197context.Features.Set<IHttpUpgradeFeature>(loggableUpgradeFeature);
UpgradeFeatureLoggingDecorator.cs (2)
11private readonly IHttpUpgradeFeature _innerUpgradeFeature; 19public UpgradeFeatureLoggingDecorator(IHttpUpgradeFeature innerUpgradeFeature, HttpLoggingInterceptorContext logContext, HttpLoggingOptions options,
Microsoft.AspNetCore.HttpLogging.Tests (22)
HttpLoggingMiddlewareTests.cs (22)
1205var upgradeFeatureMock = new Mock<IHttpUpgradeFeature>(); 1215httpContext.Features.Set<IHttpUpgradeFeature>(upgradeFeatureMock.Object); 1220await c.Features.Get<IHttpUpgradeFeature>().UpgradeAsync(); 1255var upgradeFeatureMock = new Mock<IHttpUpgradeFeature>(); 1265httpContext.Features.Set<IHttpUpgradeFeature>(upgradeFeatureMock.Object); 1270await c.Features.Get<IHttpUpgradeFeature>().UpgradeAsync(); 1309var upgradeFeatureMock = new Mock<IHttpUpgradeFeature>(); 1319httpContext.Features.Set<IHttpUpgradeFeature>(upgradeFeatureMock.Object); 1324await c.Features.Get<IHttpUpgradeFeature>().UpgradeAsync(); 1352var upgradeFeatureMock = new Mock<IHttpUpgradeFeature>(); 1362httpContext.Features.Set<IHttpUpgradeFeature>(upgradeFeatureMock.Object); 1367await c.Features.Get<IHttpUpgradeFeature>().UpgradeAsync(); 1395var upgradeFeatureMock = new Mock<IHttpUpgradeFeature>(); 1397httpContext.Features.Set<IHttpUpgradeFeature>(upgradeFeatureMock.Object); 1430var upgradeFeatureMock = new Mock<IHttpUpgradeFeature>(); 1440httpContext.Features.Set<IHttpUpgradeFeature>(upgradeFeatureMock.Object); 1448await c.Features.Get<IHttpUpgradeFeature>().UpgradeAsync(); 1469var upgradeFeatureMock = new Mock<IHttpUpgradeFeature>(); 1472httpContext.Features.Set<IHttpUpgradeFeature>(upgradeFeatureMock.Object); 1474IHttpUpgradeFeature upgradeFeature = null; 1479upgradeFeature = c.Features.Get<IHttpUpgradeFeature>(); 1491Assert.False(httpContext.Features.Get<IHttpUpgradeFeature>() is UpgradeFeatureLoggingDecorator);
Microsoft.AspNetCore.Server.HttpSys (3)
RequestProcessing\RequestContext.FeatureCollection.cs (2)
547bool IHttpUpgradeFeature.IsUpgradableRequest => IsUpgradableRequest; 549async Task<Stream> IHttpUpgradeFeature.UpgradeAsync()
StandardFeatureCollection.cs (1)
44_featureFuncLookup[typeof(IHttpUpgradeFeature)] = _identityFunc;
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (22)
Http2Tests.cs (2)
35var feature = httpContext.Features.Get<IHttpUpgradeFeature>();
OpaqueUpgradeTests.cs (20)
29var opaqueFeature = httpContext.Features.Get<IHttpUpgradeFeature>(); 56var opaqueFeature = httpContext.Features.Get<IHttpUpgradeFeature>(); 87var opaqueFeature = httpContext.Features.Get<IHttpUpgradeFeature>(); 113var opaqueFeature = httpContext.Features.Get<IHttpUpgradeFeature>(); 140var opaqueFeature = httpContext.Features.Get<IHttpUpgradeFeature>(); 173var opaqueFeature = httpContext.Features.Get<IHttpUpgradeFeature>(); 220var opaqueFeature = httpContext.Features.Get<IHttpUpgradeFeature>(); 262var opaqueFeature = httpContext.Features.Get<IHttpUpgradeFeature>(); 285var opaqueFeature = httpContext.Features.Get<IHttpUpgradeFeature>(); 312var opaqueFeature = httpContext.Features.Get<IHttpUpgradeFeature>();
Microsoft.AspNetCore.Server.IIS (4)
Core\IISHttpContext.FeatureCollection.cs (3)
273bool IHttpUpgradeFeature.IsUpgradableRequest => !RequestCanHaveBody && HttpVersion == System.Net.HttpVersion.Version11; 337async Task<Stream> IHttpUpgradeFeature.UpgradeAsync() 339if (!((IHttpUpgradeFeature)this).IsUpgradableRequest)
Core\IISHttpContext.Features.cs (1)
19private static readonly Type IHttpUpgradeFeatureType = typeof(global::Microsoft.AspNetCore.Http.Features.IHttpUpgradeFeature);
Microsoft.AspNetCore.Server.IISIntegration (1)
IISMiddleware.cs (1)
164httpContext.Features.Set<IHttpUpgradeFeature?>(null);
Microsoft.AspNetCore.Server.Kestrel.Core (11)
Internal\Http\HttpProtocol.FeatureCollection.cs (2)
150bool IHttpUpgradeFeature.IsUpgradableRequest => IsUpgradableRequest; 259async Task<Stream> IHttpUpgradeFeature.UpgradeAsync()
Internal\Http\HttpProtocol.Generated.cs (9)
49internal protected IHttpUpgradeFeature? _currentIHttpUpgradeFeature; 276else if (key == typeof(IHttpUpgradeFeature)) 428else if (key == typeof(IHttpUpgradeFeature)) 430_currentIHttpUpgradeFeature = (IHttpUpgradeFeature?)value; 582else if (typeof(TFeature) == typeof(IHttpUpgradeFeature)) 584feature = Unsafe.As<IHttpUpgradeFeature?, TFeature?>(ref _currentIHttpUpgradeFeature); 742else if (typeof(TFeature) == typeof(IHttpUpgradeFeature)) 744_currentIHttpUpgradeFeature = Unsafe.As<TFeature?, IHttpUpgradeFeature?>(ref feature); 892yield return new KeyValuePair<Type, object>(typeof(IHttpUpgradeFeature), _currentIHttpUpgradeFeature);
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (6)
Http1\Http1HttpProtocolFeatureCollectionTests.cs (2)
120_collection[typeof(IHttpUpgradeFeature)] = CreateHttp1Connection(); 150_collection.Set<IHttpUpgradeFeature>(CreateHttp1Connection());
Http2\Http2HttpProtocolFeatureCollectionTests.cs (2)
41var upgradeFeature = _http2Collection.Get<IHttpUpgradeFeature>();
Http3\Http3HttpProtocolFeatureCollectionTests.cs (2)
41var upgradeFeature = _http3Collection.Get<IHttpUpgradeFeature>();
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (2)
HttpProtocolFeatureCollection.cs (2)
152public IHttpUpgradeFeature Get_IHttpUpgradeFeature() 154return _collection.Get<IHttpUpgradeFeature>();
Microsoft.AspNetCore.TestHost (1)
HttpContextBuilder.cs (1)
56_httpContext.Features.Set<IHttpUpgradeFeature>(new UpgradeFeature());
Microsoft.AspNetCore.TestHost.Tests (4)
TestClientTests.cs (2)
1027var upgradeFeature = c.Features.Get<IHttpUpgradeFeature>();
WebSocketClientTests.cs (2)
102var upgradeFeature = c.Features.Get<IHttpUpgradeFeature>();
Microsoft.AspNetCore.WebSockets (4)
WebSocketMiddleware.cs (4)
59var upgradeFeature = context.Features.Get<IHttpUpgradeFeature>(); 92private readonly IHttpUpgradeFeature? _upgradeFeature; 99public WebSocketHandshake(HttpContext context, IHttpUpgradeFeature? upgradeFeature, IHttpExtendedConnectFeature? connectFeature, WebSocketOptions options, ILogger logger)
NativeIISSample (1)
Startup.cs (1)
89if (context.Features.Get<IHttpUpgradeFeature>() != null)