浏览代码

Don't send Exception message in Production Environment

David 5 年之前
父节点
当前提交
e9ebe07ecc
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      Emby.Server.Implementations/HttpServer/HttpListenerHost.cs

+ 6 - 0
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;