Fix issue where closed connection crashes api
This commit is contained in:
parent
a63154b581
commit
436edfde66
@ -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();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user