mirror of
https://github.com/C9Glax/tranga-website.git
synced 2025-01-30 16:37:29 +01:00
API fix CORS preflight
This commit is contained in:
parent
12b1b2afd6
commit
7e4f43f1e2
@ -54,8 +54,15 @@ public class Server
|
|||||||
SendResponse(HttpStatusCode.BadRequest, response);
|
SendResponse(HttpStatusCode.BadRequest, response);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_requestHandler.HandleRequest(request, response);
|
if (request.HttpMethod == "OPTIONS")
|
||||||
|
{
|
||||||
|
SendResponse(HttpStatusCode.OK, response);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_requestHandler.HandleRequest(request, response);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void SendResponse(HttpStatusCode statusCode, HttpListenerResponse response, object? content = null)
|
internal void SendResponse(HttpStatusCode statusCode, HttpListenerResponse response, object? content = null)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user