diff options
Diffstat (limited to 'MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs b/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs index 3795f4b15..e8bb40ba1 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; @@ -90,7 +92,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer {typeof (FileNotFoundException), 404}, {typeof (DirectoryNotFoundException), 404}, {typeof (SecurityException), 401}, - {typeof (UnauthorizedAccessException), 401} + {typeof (UnauthorizedAccessException), 500} }; HostConfig.Instance.DebugMode = true; @@ -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; |
