aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Services/ServicePath.cs
diff options
context:
space:
mode:
authortelans <telans@protonmail.com>2020-06-14 21:11:11 +1200
committertelans <telans@protonmail.com>2020-06-15 10:41:00 +1200
commitacd4389653faff01a9c5266d06979d4c20c7d5f5 (patch)
tree1fc3ae4ed71a1afb5607138aaaa79209c15bb775 /Emby.Server.Implementations/Services/ServicePath.cs
parent726e116d5bb0038edfdaa7f1672fa22df499964b (diff)
fix SA1005
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;