diff --git a/API/RequestHandler.cs b/API/RequestHandler.cs index 1778b91..9c4970e 100644 --- a/API/RequestHandler.cs +++ b/API/RequestHandler.cs @@ -80,11 +80,11 @@ public class RequestHandler private Dictionary GetRequestVariables(string query) { Dictionary ret = new(); - Regex queryRex = new (@"\?{1}([A-z]+=[A-z]+)+(&[A-z]+=[A-z]+)*"); + Regex queryRex = new (@"\?{1}&?([A-z]+=[A-z]+)+(&[A-z]+=[A-z]+)*"); if (!queryRex.IsMatch(query)) return ret; query = query.Substring(1); - foreach(string kvpair in query.Split('&')) + foreach(string kvpair in query.Split('&').Where(str => str.Length>=3 )) ret.Add(kvpair.Split('=')[0], kvpair.Split('=')[1]); return ret; }