mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Cherry picked 1e83068b8c
.
This commit is contained in:
@@ -24,16 +24,10 @@ namespace Orchard.Mvc {
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
// The "Request" property throws at application startup on IIS integrated pipeline mode.
|
||||
if (httpContext.Request == null) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
catch (Exception) {
|
||||
return null;
|
||||
}
|
||||
return httpContext;
|
||||
public HttpContextBase Current() {
|
||||
// TODO: HttpContextBase is not registred in the "shell" lifetime scope, so resolving it will cause an exception.
|
||||
|
||||
return HttpContext.Current != null ? new HttpContextWrapper(HttpContext.Current) : null;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user