mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
#5490 Fixing HttpRequestBase DependenciesShouldBeUpgradedFirst
Fixes #5490
This commit is contained in:
@@ -53,6 +53,12 @@ namespace Orchard.Mvc {
|
|||||||
// thus preventing a StackOverflowException.
|
// thus preventing a StackOverflowException.
|
||||||
var baseUrl = new Func<string>(() => siteService.GetSiteSettings().BaseUrl);
|
var baseUrl = new Func<string>(() => siteService.GetSiteSettings().BaseUrl);
|
||||||
var httpContextBase = context.Resolve<IHttpContextAccessor>().Current();
|
var httpContextBase = context.Resolve<IHttpContextAccessor>().Current();
|
||||||
|
|
||||||
|
if (httpContextBase == null) {
|
||||||
|
context.Resolve<IWorkContextAccessor>().CreateWorkContextScope();
|
||||||
|
return context.Resolve<IHttpContextAccessor>().Current();
|
||||||
|
}
|
||||||
|
|
||||||
context.Resolve<IWorkContextAccessor>().CreateWorkContextScope(httpContextBase);
|
context.Resolve<IWorkContextAccessor>().CreateWorkContextScope(httpContextBase);
|
||||||
return httpContextBase;
|
return httpContextBase;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user