aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordkanada <dkanada@users.noreply.github.com>2020-06-09 14:22:45 +0900
committerGitHub <noreply@github.com>2020-06-09 14:22:45 +0900
commit19edd11292b6f474ecfbf37224e8104a44582230 (patch)
tree39102145ed4acba0ccd05987de1090e0fd77b2fe
parentdcc131740d146da9046bfc0b7820fd2050d8e423 (diff)
parent37a4cc599ba54421f38811e6b2e6ff76fb5f45c0 (diff)
Merge pull request #3185 from Ullmie02/api-exception-handling
Don't Send Exception Messages (Old API)
-rw-r--r--Emby.Server.Implementations/HttpServer/HttpListenerHost.cs4
1 files changed, 3 insertions, 1 deletions
diff --git a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs
index 7de4f168c..b1a5c6dc5 100644
--- a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs
+++ b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs
@@ -230,7 +230,9 @@ namespace Emby.Server.Implementations.HttpServer
httpRes.StatusCode = statusCode;
- var errContent = NormalizeExceptionMessage(ex) ?? string.Empty;
+ var errContent = _hostEnvironment.IsDevelopment()
+ ? (NormalizeExceptionMessage(ex) ?? string.Empty)
+ : "Error processing request.";
httpRes.ContentType = "text/plain";
httpRes.ContentLength = errContent.Length;
await httpRes.WriteAsync(errContent).ConfigureAwait(false);