formated all files

This commit is contained in:
QkoSad
2024-12-04 15:46:10 +02:00
parent cb7b3ad94c
commit 926436860c
34 changed files with 360 additions and 169 deletions
+1 -18
View File
@@ -15,6 +15,7 @@ namespace Server
response.OutputStream.Write(buffer, 0, buffer.Length);
response.OutputStream.Write(buffer, 0, buffer.Length);
}
static void Main()
{
// create server
@@ -40,13 +41,9 @@ namespace Server
// url after localhost:5000/
string uri;
if (request != null && request.Url != null)
{
uri = request.Url.AbsolutePath;
}
else
{
return;
}
switch (request.HttpMethod)
{
case "GET":
@@ -100,20 +97,6 @@ namespace Server
HandleMissingPath(response);
break;
}
// try catch is neccessary because if you send a post with no
// body the HTTPLIstener sends response automatically. Which
// would crash the server since i try to send response but
// respose has already been sent. It took me only 2 hours :)
/* try */
/* { */
/* // send the response */
/* response.OutputStream.Close(); */
/* } */
/* catch */
/* { */
/* Console.WriteLine("Tried sending post with no body"); */
/* } */
}
}
}