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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user