Order the setting of ContextAccessor so it happens before the BeginRequest event occurs.

This commit is contained in:
Anthony van der Hoorn 2015-09-28 12:30:12 -07:00 committed by Chris R
parent 0131015b43
commit 49035fd292
1 changed files with 1 additions and 1 deletions

View File

@ -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);
} }
} }