Remove reliance on statusText for error messages. (#5056)

HTTP/2 does not support statusText, and proxies might replace it. Use the response body instead.

Closes #4729
This commit is contained in:
Jan
2023-12-12 23:17:12 +01:00
committed by GitHub
parent b08b59228c
commit 6c8ecb7b8e
10 changed files with 43 additions and 45 deletions
@@ -92,6 +92,10 @@ namespace Duplicati.Server.WebServer.RESTMethods
{
Response.Status = code;
Response.Reason = reason ?? "Error";
if(item == null && reason != null)
{
item = new { Error = reason };
}
BodyWriter.WriteJsonObject(item);
}