diff options
Diffstat (limited to 'MediaBrowser.Server.Implementations/HttpServer/Security/AuthorizationContext.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/HttpServer/Security/AuthorizationContext.cs | 45 |
1 files changed, 4 insertions, 41 deletions
diff --git a/MediaBrowser.Server.Implementations/HttpServer/Security/AuthorizationContext.cs b/MediaBrowser.Server.Implementations/HttpServer/Security/AuthorizationContext.cs index 80892b96c..509a00ff9 100644 --- a/MediaBrowser.Server.Implementations/HttpServer/Security/AuthorizationContext.cs +++ b/MediaBrowser.Server.Implementations/HttpServer/Security/AuthorizationContext.cs @@ -62,52 +62,15 @@ namespace MediaBrowser.Server.Implementations.HttpServer.Security auth.TryGetValue("Version", out version); } - var token = httpReq.Headers["X-MediaBrowser-Token"]; + var token = httpReq.Headers["X-Emby-Token"]; if (string.IsNullOrWhiteSpace(token)) { - token = httpReq.QueryString["api_key"]; + token = httpReq.Headers["X-MediaBrowser-Token"]; } - - // Hack until iOS is updated - // TODO: Remove - if (string.IsNullOrWhiteSpace(client)) - { - var userAgent = httpReq.Headers["User-Agent"] ?? string.Empty; - - if (userAgent.IndexOf("mediabrowserios", StringComparison.OrdinalIgnoreCase) != -1 || - userAgent.IndexOf("iphone", StringComparison.OrdinalIgnoreCase) != -1 || - userAgent.IndexOf("ipad", StringComparison.OrdinalIgnoreCase) != -1) - { - client = "iOS"; - } - - else if (userAgent.IndexOf("crKey", StringComparison.OrdinalIgnoreCase) != -1) - { - client = "Chromecast"; - } - } - - // Hack until iOS is updated - // TODO: Remove - if (string.IsNullOrWhiteSpace(device)) + if (string.IsNullOrWhiteSpace(token)) { - var userAgent = httpReq.Headers["User-Agent"] ?? string.Empty; - - if (userAgent.IndexOf("iPhone", StringComparison.OrdinalIgnoreCase) != -1) - { - device = "iPhone"; - } - - else if (userAgent.IndexOf("iPad", StringComparison.OrdinalIgnoreCase) != -1) - { - device = "iPad"; - } - - else if (userAgent.IndexOf("crKey", StringComparison.OrdinalIgnoreCase) != -1) - { - device = "Chromecast"; - } + token = httpReq.QueryString["api_key"]; } var info = new AuthorizationInfo |
