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