소스 검색

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;