aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Services/ServicePath.cs
diff options
context:
space:
mode:
authorBaronGreenback <jimcartlidge@yahoo.co.uk>2020-06-15 10:01:55 +0100
committerGitHub <noreply@github.com>2020-06-15 10:01:55 +0100
commit862bcdba67d3b992fc7e68a7428fc225c898fce3 (patch)
tree10a66c6cc918962cd2dad54fe85c65016af9cf9d /Emby.Server.Implementations/Services/ServicePath.cs
parent4d50941d4458dc93880d99192fd1c26a8f625d66 (diff)
parent100e9d586dff877610c488936aa035f61f6fedb5 (diff)
Merge pull request #23 from jellyfin/master
updating
Diffstat (limited to 'Emby.Server.Implementations/Services/ServicePath.cs')
-rw-r--r--Emby.Server.Implementations/Services/ServicePath.cs14
1 files changed, 7 insertions, 7 deletions
diff --git a/Emby.Server.Implementations/Services/ServicePath.cs b/Emby.Server.Implementations/Services/ServicePath.cs
index 278379a92..43869f98a 100644
--- a/Emby.Server.Implementations/Services/ServicePath.cs
+++ b/Emby.Server.Implementations/Services/ServicePath.cs
@@ -118,7 +118,7 @@ namespace Emby.Server.Implementations.Services
var componentsList = new List<string>();
- //We only split on '.' if the restPath has them. Allows for /{action}.{type}
+ // We only split on '.' if the restPath has them. Allows for /{action}.{type}
var hasSeparators = new List<bool>();
foreach (var component in this.restPath.Split(PathSeperatorChar))
{
@@ -298,12 +298,12 @@ namespace Emby.Server.Implementations.Services
return -1;
}
- //Routes with least wildcard matches get the highest score
+ // Routes with least wildcard matches get the highest score
var score = Math.Max((100 - wildcardMatchCount), 1) * 1000
- //Routes with less variable (and more literal) matches
+ // Routes with less variable (and more literal) matches
+ Math.Max((10 - VariableArgsCount), 1) * 100;
- //Exact verb match is better than ANY
+ // Exact verb match is better than ANY
if (Verbs.Length == 1 && string.Equals(httpMethod, Verbs[0], StringComparison.OrdinalIgnoreCase))
{
score += 10;
@@ -470,7 +470,7 @@ namespace Emby.Server.Implementations.Services
+ variableName + " on " + RequestType.GetMethodName());
}
- var value = requestComponents.Length > pathIx ? requestComponents[pathIx] : null; //wildcard has arg mismatch
+ var value = requestComponents.Length > pathIx ? requestComponents[pathIx] : null; // wildcard has arg mismatch
if (value != null && this.isWildcard[i])
{
if (i == this.TotalComponentsCount - 1)
@@ -519,8 +519,8 @@ namespace Emby.Server.Implementations.Services
if (queryStringAndFormData != null)
{
- //Query String and form data can override variable path matches
- //path variables < query string < form data
+ // Query String and form data can override variable path matches
+ // path variables < query string < form data
foreach (var name in queryStringAndFormData)
{
requestKeyValuesMap[name.Key] = name.Value;