mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
#20879: Fixed handling of child actions in OutputCache and SecureSocketsLayer.
Work Item: 20879
This commit is contained in:
@@ -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);
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user