Skip to content

Commit 33c3db5

Browse files
committed
Uninitialize only if the feature collection is HttpProtocol
1 parent 6433126 commit 33c3db5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Servers/Kestrel/Core/src/Internal/KestrelHttpContextFactory.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ protected override HttpContext CreateHttpContext(IFeatureCollection featureColle
4444

4545
public override void Dispose(HttpContext httpContext)
4646
{
47-
if (httpContext is DefaultHttpContext defaultHttpContext)
47+
if (httpContext.Features is HttpProtocol protocol)
4848
{
49-
defaultHttpContext.Uninitialize();
49+
protocol.HttpContext.Uninitialize();
5050
}
5151

5252
base.Dispose(httpContext);

0 commit comments

Comments
 (0)