aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs
diff options
context:
space:
mode:
authorDavid <daullmer@gmail.com>2020-05-26 16:36:54 +0200
committerDavid <daullmer@gmail.com>2020-05-26 16:36:54 +0200
commite9ebe07ecc38726ad7f14c8d38131ce101a28651 (patch)
tree8217dd9e8e1349dd0ac4bfc01691de469f51f30d /Emby.Server.Implementations/HttpServer/HttpListenerHost.cs
parent777c9c7bc974fafb09e6a5a6b23bd29cf8529af9 (diff)
Don't send Exception message in Production Environment
Diffstat (limited to 'Emby.Server.Implementations/HttpServer/HttpListenerHost.cs')
-rw-r--r--Emby.Server.Implementations/HttpServer/HttpListenerHost.cs6
1 files changed, 6 insertions, 0 deletions
diff --git a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs
index 7de4f168c..9e8c3eb9b 100644
--- a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs
+++ b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs
@@ -230,6 +230,12 @@ namespace Emby.Server.Implementations.HttpServer
httpRes.StatusCode = statusCode;
+ if (!_hostEnvironment.IsDevelopment())
+ {
+ await httpRes.WriteAsync("Error processing request.").ConfigureAwait(false);
+ return;
+ }
+
var errContent = NormalizeExceptionMessage(ex) ?? string.Empty;
httpRes.ContentType = "text/plain";
httpRes.ContentLength = errContent.Length;