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/HttpListenerHost.cs9
-rw-r--r--MediaBrowser.Server.Implementations/HttpServer/Security/AuthorizationContext.cs41
2 files changed, 9 insertions, 41 deletions
diff --git a/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs b/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs
index 3795f4b15..1885afc61 100644
--- a/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs
+++ b/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs
@@ -79,6 +79,8 @@ namespace MediaBrowser.Server.Implementations.HttpServer
_containerAdapter = new ContainerAdapter(applicationHost);
}
+ public string GlobalResponse { get; set; }
+
public override void Configure(Container container)
{
HostConfig.Instance.DefaultRedirectPath = DefaultRedirectPath;
@@ -336,6 +338,13 @@ namespace MediaBrowser.Server.Implementations.HttpServer
return Task.FromResult(true);
}
+ if (!string.IsNullOrWhiteSpace(GlobalResponse))
+ {
+ httpRes.Write(GlobalResponse);
+ httpRes.ContentType = "text/plain";
+ return Task.FromResult(true);
+ }
+
var handler = HttpHandlerFactory.GetHandler(httpReq);
var remoteIp = httpReq.RemoteIp;
diff --git a/MediaBrowser.Server.Implementations/HttpServer/Security/AuthorizationContext.cs b/MediaBrowser.Server.Implementations/HttpServer/Security/AuthorizationContext.cs
index 80892b96c..ae5ce796e 100644
--- a/MediaBrowser.Server.Implementations/HttpServer/Security/AuthorizationContext.cs
+++ b/MediaBrowser.Server.Implementations/HttpServer/Security/AuthorizationContext.cs
@@ -69,47 +69,6 @@ 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";
- }
- }
-
var info = new AuthorizationInfo
{
Client = client,