mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
@@ -418,26 +418,23 @@ namespace Orchard.OutputCache.Filters {
|
||||
Logger.Debug("Redirect on POST");
|
||||
var redirectUrl = redirectResult.Url;
|
||||
|
||||
if (!VirtualPathUtility.IsAbsolute(redirectUrl)) {
|
||||
var applicationRoot = new UrlHelper(filterContext.HttpContext.Request.RequestContext).MakeAbsolute("/");
|
||||
if (redirectUrl.StartsWith(applicationRoot, StringComparison.OrdinalIgnoreCase)) {
|
||||
redirectUrl = "~/" + redirectUrl.Substring(applicationRoot.Length);
|
||||
redirectUrl = VirtualPathUtility.ToAbsolute(redirectUrl);
|
||||
}
|
||||
if (filterContext.HttpContext.Request.IsLocalUrl(redirectUrl)) {
|
||||
var helper = new UrlHelper(filterContext.HttpContext.Request.RequestContext);
|
||||
var absolutePath = new Uri(helper.MakeAbsolute(redirectUrl)).AbsolutePath;
|
||||
|
||||
// querystring invariant key
|
||||
var invariantCacheKey = ComputeCacheKey(
|
||||
_shellSettings.Name,
|
||||
absolutePath,
|
||||
() => _workContext.CurrentCulture,
|
||||
_themeManager.GetRequestTheme(filterContext.RequestContext).Id,
|
||||
null
|
||||
);
|
||||
|
||||
// remove all cached version of the same page
|
||||
_cacheService.RemoveByTag(invariantCacheKey);
|
||||
}
|
||||
|
||||
// querystring invariant key
|
||||
var invariantCacheKey = ComputeCacheKey(
|
||||
_shellSettings.Name,
|
||||
redirectUrl,
|
||||
() => _workContext.CurrentCulture,
|
||||
_themeManager.GetRequestTheme(filterContext.RequestContext).Id,
|
||||
null
|
||||
);
|
||||
|
||||
// remove all cached version of the same page
|
||||
_cacheService.RemoveByTag(invariantCacheKey);
|
||||
|
||||
// adding a refresh key so that the redirection doesn't get restored
|
||||
// from a cached version on a proxy
|
||||
// this can happen when using public caching, we want to force the
|
||||
|
||||
Reference in New Issue
Block a user