mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +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 IWorkContextAccessor _workContextAccessor;
|
||||||
private readonly IHttpAsyncHandler _httpAsyncHandler;
|
private readonly IHttpAsyncHandler _httpAsyncHandler;
|
||||||
private readonly Func<IDictionary<string, object>, Task> _pipeline;
|
private readonly Func<IDictionary<string, object>, Task> _pipeline;
|
||||||
@@ -181,6 +181,13 @@ namespace Orchard.Mvc.Routes {
|
|||||||
await _pipeline.Invoke(environment);
|
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