Skip to content

Commit 56cac8f

Browse files
committed
Move Uninitialize call to HttpProtocol.Reset
1 parent 33c3db5 commit 56cac8f

File tree

3 files changed

+3
-11
lines changed

3 files changed

+3
-11
lines changed

src/Http/Http/src/HttpContextFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ protected virtual HttpContext CreateHttpContext(IFeatureCollection featureCollec
5252
return new DefaultHttpContext(featureCollection);
5353
}
5454

55-
public virtual void Dispose(HttpContext httpContext)
55+
public void Dispose(HttpContext httpContext)
5656
{
5757
if (_httpContextAccessor != null)
5858
{

src/Servers/Kestrel/Core/src/Internal/Http/HttpProtocol.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,8 @@ public void Reset()
362362

363363
_responseBytesWritten = 0;
364364

365+
HttpContext?.Uninitialize();
366+
365367
OnReset();
366368
}
367369

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,5 @@ protected override HttpContext CreateHttpContext(IFeatureCollection featureColle
4141
// Since Kestrel is registered by default, we need to fallback to the default behavior
4242
return base.CreateHttpContext(featureCollection);
4343
}
44-
45-
public override void Dispose(HttpContext httpContext)
46-
{
47-
if (httpContext.Features is HttpProtocol protocol)
48-
{
49-
protocol.HttpContext.Uninitialize();
50-
}
51-
52-
base.Dispose(httpContext);
53-
}
5444
}
5545
}

0 commit comments

Comments
 (0)