mirror of
https://github.com/C9Glax/tranga.git
synced 2025-01-12 03:17:33 +01:00
API Fix closed response socket
This commit is contained in:
parent
8058749ab5
commit
fd1b2a8470
@ -67,6 +67,8 @@ public class Server
|
|||||||
|
|
||||||
internal void SendResponse(HttpStatusCode statusCode, HttpListenerResponse response, object? content = null)
|
internal void SendResponse(HttpStatusCode statusCode, HttpListenerResponse response, object? content = null)
|
||||||
{
|
{
|
||||||
|
if (!response.OutputStream.CanWrite)
|
||||||
|
return;
|
||||||
//logger?.WriteLine(this.GetType().ToString(), $"Sending response: {statusCode}");
|
//logger?.WriteLine(this.GetType().ToString(), $"Sending response: {statusCode}");
|
||||||
response.StatusCode = (int)statusCode;
|
response.StatusCode = (int)statusCode;
|
||||||
response.AddHeader("Access-Control-Allow-Headers", "Content-Type, Accept, X-Requested-With");
|
response.AddHeader("Access-Control-Allow-Headers", "Content-Type, Accept, X-Requested-With");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user