mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-20 17:14:42 +01:00
Set response length and mime type correctly when reporting an error
This commit is contained in:
@@ -233,8 +233,10 @@ namespace Emby.Server.Implementations.HttpServer
|
||||
var statusCode = GetStatusCode(ex);
|
||||
httpRes.StatusCode = statusCode;
|
||||
|
||||
httpRes.ContentType = "text/html";
|
||||
await httpRes.WriteAsync(NormalizeExceptionMessage(ex.Message)).ConfigureAwait(false);
|
||||
var errContent = NormalizeExceptionMessage(ex.Message);
|
||||
httpRes.ContentType = "text/plain";
|
||||
httpRes.ContentLength = errContent.Length;
|
||||
await httpRes.WriteAsync(errContent).ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception errorEx)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user