diff options
| author | Bond_009 <bond.009@outlook.com> | 2019-08-09 22:37:44 +0200 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2019-08-09 22:37:44 +0200 |
| commit | 0116190050be69b2ac61d46681f2c7478a1318b9 (patch) | |
| tree | d6b0c88e0dd9d649eb3f7cf8da2c122494b48508 /Emby.Server.Implementations/Services/ServiceHandler.cs | |
| parent | cf7290343ff4a440537c61332cdc76c5fbcbb7e9 (diff) | |
Minor changes
Diffstat (limited to 'Emby.Server.Implementations/Services/ServiceHandler.cs')
| -rw-r--r-- | Emby.Server.Implementations/Services/ServiceHandler.cs | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/Emby.Server.Implementations/Services/ServiceHandler.cs b/Emby.Server.Implementations/Services/ServiceHandler.cs index cf15247bb..934560de3 100644 --- a/Emby.Server.Implementations/Services/ServiceHandler.cs +++ b/Emby.Server.Implementations/Services/ServiceHandler.cs @@ -122,7 +122,7 @@ namespace Emby.Server.Implementations.Services public static object CreateRequest(IRequest httpReq, RestPath restPath, Dictionary<string, string> requestParams, object requestDto) { var pathInfo = !restPath.IsWildCardPath - ? GetSanitizedPathInfo(httpReq.PathInfo, out string contentType) + ? GetSanitizedPathInfo(httpReq.PathInfo, out _) : httpReq.PathInfo; return restPath.CreateRequest(pathInfo, requestParams, requestDto); @@ -146,13 +146,12 @@ namespace Emby.Server.Implementations.Services { for (var i = 0; i < values.Count; i++) { - map[pair.Key + (i == 0 ? "" : "#" + i)] = values[i]; + map[pair.Key + (i == 0 ? string.Empty : "#" + i)] = values[i]; } } } - if ( - (IsMethod(request.Method, "POST") || IsMethod(request.Method, "PUT")) + if ((IsMethod(request.Method, "POST") || IsMethod(request.Method, "PUT")) && request.HasFormContentType) { foreach (var pair in request.Form) @@ -166,7 +165,7 @@ namespace Emby.Server.Implementations.Services { for (var i = 0; i < values.Count; i++) { - map[pair.Key + (i == 0 ? "" : "#" + i)] = values[i]; + map[pair.Key + (i == 0 ? string.Empty : "#" + i)] = values[i]; } } } @@ -176,9 +175,7 @@ namespace Emby.Server.Implementations.Services } private static bool IsMethod(string method, string expected) - { - return string.Equals(method, expected, StringComparison.OrdinalIgnoreCase); - } + => string.Equals(method, expected, StringComparison.OrdinalIgnoreCase); /// <summary> /// Duplicate params have their values joined together in a comma-delimited string @@ -192,8 +189,7 @@ namespace Emby.Server.Implementations.Services map[pair.Key] = pair.Value; } - if ( - (IsMethod(request.Method, "POST") || IsMethod(request.Method, "PUT")) + if ((IsMethod(request.Method, "POST") || IsMethod(request.Method, "PUT")) && request.HasFormContentType) { foreach (var pair in request.Form) |
