First version
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user