mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Fixing that the new HttpAsyncHandler didn't expose the RequestContext, causing injected RequestContext objects to be empty
This commit is contained in:
@@ -145,7 +145,7 @@ namespace Orchard.Mvc.Routes {
|
||||
}
|
||||
}
|
||||
|
||||
class HttpAsyncHandler : HttpTaskAsyncHandler, IRequiresSessionState {
|
||||
class HttpAsyncHandler : HttpTaskAsyncHandler, IRequiresSessionState, IHasRequestContext {
|
||||
private readonly IWorkContextAccessor _workContextAccessor;
|
||||
private readonly IHttpAsyncHandler _httpAsyncHandler;
|
||||
private readonly Func<IDictionary<string, object>, Task> _pipeline;
|
||||
@@ -181,6 +181,13 @@ namespace Orchard.Mvc.Routes {
|
||||
await _pipeline.Invoke(environment);
|
||||
}
|
||||
}
|
||||
|
||||
public RequestContext RequestContext {
|
||||
get {
|
||||
var mvcHandler = _httpAsyncHandler as MvcHandler;
|
||||
return mvcHandler == null ? null : mvcHandler.RequestContext;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user