#20879: Fixed handling of child actions in OutputCache and SecureSocketsLayer.

Work Item: 20879
This commit is contained in:
Daniel Stolt
2015-03-22 14:41:02 +01:00
parent bdc64df4eb
commit c80c961513
2 changed files with 11 additions and 8 deletions

View File

@@ -83,6 +83,13 @@ namespace Orchard.OutputCache.Filters {
Logger.Debug("Incoming request for URL '{0}'.", filterContext.RequestContext.HttpContext.Request.RawUrl);
// This filter is not reentrant (multiple executions within the same request are
// not supported) so child actions are ignored completely.
if (filterContext.IsChildAction) {
Logger.Debug("Request for URL '{0}' ignored because it's a child action.", filterContext.RequestContext.HttpContext.Request.RawUrl);
return;
}
_now = _clock.UtcNow;
_workContext = _workContextAccessor.GetContext();
_cacheKey = ComputeCacheKey(filterContext, GetCacheKeyParameters(filterContext));
@@ -170,7 +177,9 @@ namespace Orchard.OutputCache.Filters {
try {
if (!_isCachingRequest)
// This filter is not reentrant (multiple executions within the same request are
// not supported) so child actions are ignored completely.
if (filterContext.IsChildAction || !_isCachingRequest)
return;
Logger.Debug("Item '{0}' was rendered.", _cacheKey);
@@ -272,12 +281,6 @@ namespace Orchard.OutputCache.Filters {
return false;
}
// Ignore child actions, e.g. HomeController is using RenderAction()
if (filterContext.IsChildAction) {
Logger.Debug("Request for item '{0}' ignored because it's a child action.", _cacheKey);
return false;
}
// Ignore authenticated requests unless the setting to cache them is true.
if (_workContext.CurrentUser != null && !CacheSettings.CacheAuthenticatedRequests) {
Logger.Debug("Request for item '{0}' ignored because user is authenticated.", _cacheKey);

View File

@@ -27,7 +27,7 @@ namespace Orchard.SecureSocketsLayer.Filters {
public void OnActionExecuting(ActionExecutingContext filterContext) {
var settings = _sslService.GetSettings();
if (!settings.Enabled) {
if (filterContext.IsChildAction || !settings.Enabled) {
return;
}