Fixed error messages for requests with no response

This commit is contained in:
Kenneth Skovhede
2024-07-18 21:29:36 +02:00
parent 71728840be
commit dfbcff5d47
@@ -338,6 +338,9 @@ namespace Duplicati.GUI.TrayIcon
var response = await HTTPCLIENT.SendAsync(request, cts.Token);
response.EnsureSuccessStatusCode();
if (typeof(T) == typeof(string))
return (T)(object)await response.Content.ReadAsStringAsync();
using (var stream = await response.Content.ReadAsStreamAsync())
return await JsonSerializer.DeserializeAsync<T>(stream, serializerOptions);
}