aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/HttpServer
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Server.Implementations/HttpServer')
-rw-r--r--MediaBrowser.Server.Implementations/HttpServer/Security/AuthService.cs2
-rw-r--r--MediaBrowser.Server.Implementations/HttpServer/Security/AuthorizationContext.cs41
2 files changed, 42 insertions, 1 deletions
diff --git a/MediaBrowser.Server.Implementations/HttpServer/Security/AuthService.cs b/MediaBrowser.Server.Implementations/HttpServer/Security/AuthService.cs
index 48de68e51..295f0c775 100644
--- a/MediaBrowser.Server.Implementations/HttpServer/Security/AuthService.cs
+++ b/MediaBrowser.Server.Implementations/HttpServer/Security/AuthService.cs
@@ -66,7 +66,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer.Security
if (!authAttribtues.AllowLocal || !req.IsLocal)
{
if (!string.IsNullOrWhiteSpace(auth.Token) ||
- !_config.Configuration.InsecureApps5.Contains(auth.Client ?? string.Empty, StringComparer.OrdinalIgnoreCase))
+ !_config.Configuration.InsecureApps6.Contains(auth.Client ?? string.Empty, StringComparer.OrdinalIgnoreCase))
{
var valid = IsValidConnectKey(auth.Token);
diff --git a/MediaBrowser.Server.Implementations/HttpServer/Security/AuthorizationContext.cs b/MediaBrowser.Server.Implementations/HttpServer/Security/AuthorizationContext.cs
index 925eb6a86..3cc703bbf 100644
--- a/MediaBrowser.Server.Implementations/HttpServer/Security/AuthorizationContext.cs
+++ b/MediaBrowser.Server.Implementations/HttpServer/Security/AuthorizationContext.cs
@@ -43,6 +43,47 @@ namespace MediaBrowser.Server.Implementations.HttpServer.Security
token = httpReq.QueryString["api_key"];
}
+ // 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))
+ {
+ 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";
+ }
+ }
+
return new AuthorizationInfo
{
Client = client,