Fix issue where closed connection crashes api

This commit is contained in:
glax 2023-07-31 22:58:41 +02:00
parent a63154b581
commit 436edfde66

View File

@ -82,12 +82,11 @@ public class Server
response.OutputStream.Write(content is not null response.OutputStream.Write(content is not null
? Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(content)) ? Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(content))
: Array.Empty<byte>()); : Array.Empty<byte>());
response.OutputStream.Close();
} }
catch (HttpListenerException) catch (HttpListenerException)
{ {
} }
response.OutputStream.Close();
} }
} }