formated all files
This commit is contained in:
+1
-18
@@ -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"); */
|
||||
/* } */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user