First version

This commit is contained in:
Michael Nolan
2022-04-02 16:15:20 -05:00
parent c144565f70
commit d9e66a1427
9 changed files with 654 additions and 79 deletions
+5 -4
View File
@@ -15,7 +15,7 @@ namespace Tesses.WebServer
RequestHeaders = headers;
ResponseHeaders = new Dictionary<string, List<string>>();
var qp = new Dictionary<string, List<string>>();
QueryParams = qp;
StatusCode = 200;
// /joel/path/luigi?local=jim&john_surname=connor&demi_surname=lovato&local=tim
@@ -29,8 +29,9 @@ namespace Tesses.WebServer
{
//local=jim&john_surname=connor&demi_surname=lovato&local=tim
//we want to split on &
foreach(var item in splitUrl[1].Split(new char[] { '&'},2))
foreach(var item in splitUrl[1].Split(new char[] { '&'},StringSplitOptions.RemoveEmptyEntries))
{
//Console.WriteLine(item);
var itemSplit = item.Split(new char[] { '=' }, 2);
if(itemSplit.Length > 0)
{
@@ -40,12 +41,12 @@ namespace Tesses.WebServer
{
value = itemSplit[1];
}
qp.Add(key, value); //hince qp is reference to QueryParams
qp.Add(key, value);
}
}
}
}
QueryParams = qp;
}
private string get_host()
{