2
0

API fix CORS preflight

This commit is contained in:
glax 2023-06-21 16:53:07 +02:00
parent 12b1b2afd6
commit 7e4f43f1e2

View File

@ -55,8 +55,15 @@ public class Server
return; return;
} }
if (request.HttpMethod == "OPTIONS")
{
SendResponse(HttpStatusCode.OK, response);
}
else
{
_requestHandler.HandleRequest(request, response); _requestHandler.HandleRequest(request, response);
} }
}
internal void SendResponse(HttpStatusCode statusCode, HttpListenerResponse response, object? content = null) internal void SendResponse(HttpStatusCode statusCode, HttpListenerResponse response, object? content = null)
{ {