aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Services
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Server.Implementations/Services')
-rw-r--r--Emby.Server.Implementations/Services/ResponseHelper.cs2
-rw-r--r--Emby.Server.Implementations/Services/ServiceController.cs5
-rw-r--r--Emby.Server.Implementations/Services/ServiceExec.cs9
-rw-r--r--Emby.Server.Implementations/Services/ServicePath.cs11
4 files changed, 22 insertions, 5 deletions
diff --git a/Emby.Server.Implementations/Services/ResponseHelper.cs b/Emby.Server.Implementations/Services/ResponseHelper.cs
index 3f1672e94..a329b531d 100644
--- a/Emby.Server.Implementations/Services/ResponseHelper.cs
+++ b/Emby.Server.Implementations/Services/ResponseHelper.cs
@@ -40,7 +40,9 @@ namespace Emby.Server.Implementations.Services
if (httpResult != null)
{
if (httpResult.RequestContext == null)
+ {
httpResult.RequestContext = request;
+ }
response.StatusCode = httpResult.Status;
}
diff --git a/Emby.Server.Implementations/Services/ServiceController.cs b/Emby.Server.Implementations/Services/ServiceController.cs
index b84e47140..857df591a 100644
--- a/Emby.Server.Implementations/Services/ServiceController.cs
+++ b/Emby.Server.Implementations/Services/ServiceController.cs
@@ -144,7 +144,10 @@ namespace Emby.Server.Implementations.Services
var yieldedWildcardMatches = RestPath.GetFirstMatchWildCardHashKeys(matchUsingPathParts);
foreach (var potentialHashMatch in yieldedWildcardMatches)
{
- if (!this.RestPathMap.TryGetValue(potentialHashMatch, out firstMatches)) continue;
+ if (!this.RestPathMap.TryGetValue(potentialHashMatch, out firstMatches))
+ {
+ continue;
+ }
var bestScore = -1;
RestPath bestMatch = null;
diff --git a/Emby.Server.Implementations/Services/ServiceExec.cs b/Emby.Server.Implementations/Services/ServiceExec.cs
index 606f2a240..cbc4b754d 100644
--- a/Emby.Server.Implementations/Services/ServiceExec.cs
+++ b/Emby.Server.Implementations/Services/ServiceExec.cs
@@ -42,11 +42,15 @@ namespace Emby.Server.Implementations.Services
}
if (mi.GetParameters().Length != 1)
+ {
continue;
+ }
var actionName = mi.Name;
if (!AllVerbs.Contains(actionName, StringComparer.OrdinalIgnoreCase))
+ {
continue;
+ }
list.Add(mi);
}
@@ -63,7 +67,10 @@ namespace Emby.Server.Implementations.Services
{
foreach (var actionCtx in actions)
{
- if (execMap.ContainsKey(actionCtx.Id)) continue;
+ if (execMap.ContainsKey(actionCtx.Id))
+ {
+ continue;
+ }
execMap[actionCtx.Id] = actionCtx;
}
diff --git a/Emby.Server.Implementations/Services/ServicePath.cs b/Emby.Server.Implementations/Services/ServicePath.cs
index 3b7ffaf2c..89538ae72 100644
--- a/Emby.Server.Implementations/Services/ServicePath.cs
+++ b/Emby.Server.Implementations/Services/ServicePath.cs
@@ -124,7 +124,10 @@ namespace Emby.Server.Implementations.Services
var hasSeparators = new List<bool>();
foreach (var component in this.restPath.Split(PathSeperatorChar))
{
- if (string.IsNullOrEmpty(component)) continue;
+ if (string.IsNullOrEmpty(component))
+ {
+ continue;
+ }
if (component.IndexOf(VariablePrefix, StringComparison.OrdinalIgnoreCase) != -1
&& component.IndexOf(ComponentSeperator) != -1)
@@ -302,9 +305,9 @@ namespace Emby.Server.Implementations.Services
}
// Routes with least wildcard matches get the highest score
- var score = Math.Max((100 - wildcardMatchCount), 1) * 1000
+ var score = Math.Max(100 - wildcardMatchCount, 1) * 1000
// Routes with less variable (and more literal) matches
- + Math.Max((10 - VariableArgsCount), 1) * 100;
+ + Math.Max(10 - VariableArgsCount, 1) * 100;
// Exact verb match is better than ANY
if (Verbs.Length == 1 && string.Equals(httpMethod, Verbs[0], StringComparison.OrdinalIgnoreCase))
@@ -442,12 +445,14 @@ namespace Emby.Server.Implementations.Services
&& requestComponents.Length >= this.TotalComponentsCount - this.wildcardCount;
if (!isValidWildCardPath)
+ {
throw new ArgumentException(
string.Format(
CultureInfo.InvariantCulture,
"Path Mismatch: Request Path '{0}' has invalid number of components compared to: '{1}'",
pathInfo,
this.restPath));
+ }
}
var requestKeyValuesMap = new Dictionary<string, string>();