Order the setting of ContextAccessor so it happens before the BeginRequest event occurs.
This commit is contained in:
parent
0131015b43
commit
49035fd292
|
|
@ -96,6 +96,7 @@ namespace Microsoft.AspNet.Hosting.Internal
|
||||||
var httpContext = contextFactory.CreateHttpContext(features);
|
var httpContext = contextFactory.CreateHttpContext(features);
|
||||||
httpContext.ApplicationServices = _applicationServices;
|
httpContext.ApplicationServices = _applicationServices;
|
||||||
var requestIdentifier = GetRequestIdentifier(httpContext);
|
var requestIdentifier = GetRequestIdentifier(httpContext);
|
||||||
|
contextAccessor.HttpContext = httpContext;
|
||||||
|
|
||||||
if (telemetrySource.IsEnabled("Microsoft.AspNet.Hosting.BeginRequest"))
|
if (telemetrySource.IsEnabled("Microsoft.AspNet.Hosting.BeginRequest"))
|
||||||
{
|
{
|
||||||
|
|
@ -106,7 +107,6 @@ namespace Microsoft.AspNet.Hosting.Internal
|
||||||
{
|
{
|
||||||
using (logger.BeginScope("Request Id: {RequestId}", requestIdentifier))
|
using (logger.BeginScope("Request Id: {RequestId}", requestIdentifier))
|
||||||
{
|
{
|
||||||
contextAccessor.HttpContext = httpContext;
|
|
||||||
await application(httpContext);
|
await application(httpContext);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue