aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Services/ServicePath.cs
diff options
context:
space:
mode:
authorBond_009 <bond.009@outlook.com>2018-12-14 20:17:29 +0100
committerBond_009 <bond.009@outlook.com>2018-12-30 22:44:38 +0100
commitb7ebb67cbbad8c670215a3c24401a1047bbaea5e (patch)
treed557170c76be0480e58813c3cf359d0043c3adec /Emby.Server.Implementations/Services/ServicePath.cs
parent3d3ec3588b523bd6f47795886ef9bdaebc850f95 (diff)
Remove the need for NullLogger
Diffstat (limited to 'Emby.Server.Implementations/Services/ServicePath.cs')
-rw-r--r--Emby.Server.Implementations/Services/ServicePath.cs14
1 files changed, 4 insertions, 10 deletions
diff --git a/Emby.Server.Implementations/Services/ServicePath.cs b/Emby.Server.Implementations/Services/ServicePath.cs
index ef64d20b4..ac2af3eaf 100644
--- a/Emby.Server.Implementations/Services/ServicePath.cs
+++ b/Emby.Server.Implementations/Services/ServicePath.cs
@@ -309,10 +309,10 @@ namespace Emby.Server.Implementations.Services
private readonly Dictionary<string, string> propertyNamesMap = new Dictionary<string, string>();
- public int MatchScore(string httpMethod, string[] withPathInfoParts, ILogger logger)
+ public int MatchScore(string httpMethod, string[] withPathInfoParts)
{
int wildcardMatchCount;
- var isMatch = IsMatch(httpMethod, withPathInfoParts, logger, out wildcardMatchCount);
+ var isMatch = IsMatch(httpMethod, withPathInfoParts, out wildcardMatchCount);
if (!isMatch)
{
return -1;
@@ -348,31 +348,27 @@ namespace Emby.Server.Implementations.Services
/// For performance withPathInfoParts should already be a lower case string
/// to minimize redundant matching operations.
/// </summary>
- public bool IsMatch(string httpMethod, string[] withPathInfoParts, ILogger logger, out int wildcardMatchCount)
+ public bool IsMatch(string httpMethod, string[] withPathInfoParts, out int wildcardMatchCount)
{
wildcardMatchCount = 0;
if (withPathInfoParts.Length != this.PathComponentsCount && !this.IsWildCardPath)
{
- //logger.LogInformation("withPathInfoParts mismatch for {0} for {1}", httpMethod, string.Join("/", withPathInfoParts));
- return false;
+ return false;
}
if (!Verbs.Contains(httpMethod, StringComparer.OrdinalIgnoreCase))
{
- //logger.LogInformation("allowsAllVerbs mismatch for {0} for {1} allowedverbs {2}", httpMethod, string.Join("/", withPathInfoParts), this.allowedVerbs);
return false;
}
if (!ExplodeComponents(ref withPathInfoParts))
{
- //logger.LogInformation("ExplodeComponents mismatch for {0} for {1}", httpMethod, string.Join("/", withPathInfoParts));
return false;
}
if (this.TotalComponentsCount != withPathInfoParts.Length && !this.IsWildCardPath)
{
- //logger.LogInformation("TotalComponentsCount mismatch for {0} for {1}", httpMethod, string.Join("/", withPathInfoParts));
return false;
}
@@ -393,7 +389,6 @@ namespace Emby.Server.Implementations.Services
// Ensure there are still enough parts left to match the remainder
if ((withPathInfoParts.Length - pathIx) < (this.TotalComponentsCount - i - 1))
{
- //logger.LogInformation("withPathInfoParts length mismatch for {0} for {1}", httpMethod, string.Join("/", withPathInfoParts));
return false;
}
}
@@ -416,7 +411,6 @@ namespace Emby.Server.Implementations.Services
if (withPathInfoParts.Length <= pathIx || !LiteralsEqual(withPathInfoParts[pathIx], literalToMatch))
{
- //logger.LogInformation("withPathInfoParts2 length mismatch for {0} for {1}. not equals: {2} != {3}.", httpMethod, string.Join("/", withPathInfoParts), withPathInfoParts[pathIx], literalToMatch);
return false;
}
pathIx++;