aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/HttpServer/Security/AuthorizationContext.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2017-08-30 14:52:29 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2017-08-30 14:52:29 -0400
commit0f23c7cfc1372ead03ab9b818e698441d4d53bd3 (patch)
tree3bade7be91c556ec752a7ab8598128fa14c234d8 /Emby.Server.Implementations/HttpServer/Security/AuthorizationContext.cs
parent8de80d43ba496535aac89d9ec260d8dc2550169b (diff)
3.2.30.3
Diffstat (limited to 'Emby.Server.Implementations/HttpServer/Security/AuthorizationContext.cs')
-rw-r--r--Emby.Server.Implementations/HttpServer/Security/AuthorizationContext.cs6
1 files changed, 3 insertions, 3 deletions
diff --git a/Emby.Server.Implementations/HttpServer/Security/AuthorizationContext.cs b/Emby.Server.Implementations/HttpServer/Security/AuthorizationContext.cs
index ede85fb67..f40277778 100644
--- a/Emby.Server.Implementations/HttpServer/Security/AuthorizationContext.cs
+++ b/Emby.Server.Implementations/HttpServer/Security/AuthorizationContext.cs
@@ -3,8 +3,8 @@ using MediaBrowser.Controller.Net;
using MediaBrowser.Controller.Security;
using System;
using System.Collections.Generic;
-using System.Linq;
using MediaBrowser.Model.Services;
+using System.Linq;
namespace Emby.Server.Implementations.HttpServer.Security
{
@@ -90,7 +90,7 @@ namespace Emby.Server.Implementations.HttpServer.Security
AccessToken = token
});
- var tokenInfo = result.Items.FirstOrDefault();
+ var tokenInfo = result.Items.Length > 0 ? result.Items[0] : null;
if (tokenInfo != null)
{
@@ -161,7 +161,7 @@ namespace Emby.Server.Implementations.HttpServer.Security
// There should be at least to parts
if (parts.Length != 2) return null;
- var acceptedNames = new[] { "MediaBrowser", "Emby"};
+ var acceptedNames = new[] { "MediaBrowser", "Emby" };
// It has to be a digest request
if (!acceptedNames.Contains(parts[0] ?? string.Empty, StringComparer.OrdinalIgnoreCase))