2
0

API Fix closed response socket

This commit is contained in:
glax 2023-06-21 17:29:20 +02:00
parent 8058749ab5
commit fd1b2a8470

View File

@ -67,6 +67,8 @@ public class Server
internal void SendResponse(HttpStatusCode statusCode, HttpListenerResponse response, object? content = null)
{
if (!response.OutputStream.CanWrite)
return;
//logger?.WriteLine(this.GetType().ToString(), $"Sending response: {statusCode}");
response.StatusCode = (int)statusCode;
response.AddHeader("Access-Control-Allow-Headers", "Content-Type, Accept, X-Requested-With");