diff options
| author | Luke <luke.pulverenti@gmail.com> | 2015-10-26 18:50:19 -0400 |
|---|---|---|
| committer | Luke <luke.pulverenti@gmail.com> | 2015-10-26 18:50:19 -0400 |
| commit | 35778ebc02e5931142a1fe31a256b7488a07c5c2 (patch) | |
| tree | ced0290be8820f5e507b51ca4c5165212b1879d1 /MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs | |
| parent | c0dc8d055bfd4d2f58591083beb9e9128357aad6 (diff) | |
| parent | 8d77308593c3b16b733b0109323770d9dfe7e166 (diff) | |
Merge pull request #1222 from MediaBrowser/dev
3.0.5768.7
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; |
