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