فهرست منبع

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;
             httpRes.StatusCode = statusCode;
 
 
+            if (!_hostEnvironment.IsDevelopment())
+            {
+                await httpRes.WriteAsync("Error processing request.").ConfigureAwait(false);
+                return;
+            }
+
             var errContent = NormalizeExceptionMessage(ex) ?? string.Empty;
             var errContent = NormalizeExceptionMessage(ex) ?? string.Empty;
             httpRes.ContentType = "text/plain";
             httpRes.ContentType = "text/plain";
             httpRes.ContentLength = errContent.Length;
             httpRes.ContentLength = errContent.Length;