This commit is contained in:
Sipke Schoorstra
2015-05-28 00:59:48 +02:00
parent f0cd135993
commit c9887f4d39

View File

@@ -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;
}
}
}