mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Preventing shell resolution when unnecessary
--HG-- branch : 1.x
This commit is contained in:
@@ -60,7 +60,8 @@ namespace Orchard.Environment {
|
||||
s.RequestUrlHost.Split(new [] {','}, StringSplitOptions.RemoveEmptyEntries)
|
||||
.Select(h => new ShellSettings(s) {RequestUrlHost = h}))
|
||||
.GroupBy(s => s.RequestUrlHost ?? string.Empty)
|
||||
.OrderByDescending(g => g.Key.Length);
|
||||
.OrderByDescending(g => g.Key.Length)
|
||||
.ToArray();
|
||||
|
||||
if (unqualified.Count() == 1) {
|
||||
// only one shell had no request url criteria
|
||||
@@ -85,6 +86,11 @@ namespace Orchard.Environment {
|
||||
}
|
||||
|
||||
public ShellSettings Match(string host, string appRelativePath) {
|
||||
// optimized path when only one tenant (Default)
|
||||
if (!_shellsByHost.Any()) {
|
||||
return _fallback;
|
||||
}
|
||||
|
||||
var hostLength = host.IndexOf(':');
|
||||
if (hostLength != -1)
|
||||
host = host.Substring(0, hostLength);
|
||||
|
||||
Reference in New Issue
Block a user