updates login redirect logic to be more inline with v7, less greedy which is better.
This commit is contained in:
@@ -100,29 +100,6 @@ namespace Umbraco.Core
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks if it is a back office login or logout request
|
||||
/// </summary>
|
||||
/// <param name="url"></param>
|
||||
/// <param name="applicationPath"></param>
|
||||
/// <returns></returns>
|
||||
internal static bool IsBackOfficeLoginRequest(this Uri url, string applicationPath)
|
||||
{
|
||||
applicationPath = applicationPath ?? string.Empty;
|
||||
|
||||
var fullUrlPath = url.AbsolutePath.TrimStart(new[] { '/' });
|
||||
var appPath = applicationPath.TrimStart(new[] { '/' });
|
||||
var urlPath = fullUrlPath.TrimStart(appPath).EnsureStartsWith('/');
|
||||
|
||||
if (urlPath.InvariantStartsWith(GlobalSettings.Path.EnsureStartsWith('/') + "/login.aspx")
|
||||
|| urlPath.InvariantStartsWith(GlobalSettings.Path.EnsureStartsWith('/') + "/logout.aspx"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks if the current uri is an install request
|
||||
/// </summary>
|
||||
@@ -139,6 +116,23 @@ namespace Umbraco.Core
|
||||
return afterAuthority.InvariantStartsWith(IOHelper.ResolveUrl("~/install").TrimStart("/"));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks if the uri is a request for the default back office page
|
||||
/// </summary>
|
||||
/// <param name="url"></param>
|
||||
/// <returns></returns>
|
||||
internal static bool IsDefaultBackOfficeRequest(this Uri url)
|
||||
{
|
||||
if (url.AbsolutePath.InvariantEquals(GlobalSettings.Path.TrimEnd("/"))
|
||||
|| url.AbsolutePath.InvariantEquals(GlobalSettings.Path.EnsureEndsWith('/'))
|
||||
|| url.AbsolutePath.InvariantStartsWith(GlobalSettings.Path.EnsureEndsWith('/') + "Default.aspx")
|
||||
|| url.AbsolutePath.InvariantStartsWith(GlobalSettings.Path.EnsureEndsWith('/') + "Umbraco.aspx"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This is a performance tweak to check if this is a .css, .js or .ico, .jpg, .jpeg, .png, .gif file request since
|
||||
/// .Net will pass these requests through to the module when in integrated mode.
|
||||
|
||||
Reference in New Issue
Block a user