Don't send Exception message in Production Environment

This commit is contained in:
David 2020-05-26 16:36:54 +02:00
parent 777c9c7bc9
commit e9ebe07ecc

View file

@ -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;