This commit is contained in:
uwaa 2024-10-29 02:50:11 +00:00
parent 036b34233f
commit 2f0d5af790

View file

@ -121,13 +121,14 @@ public sealed class HttpServer
//Parse path
ArraySegment<string> pathSpl = req.Path.Split('/', StringSplitOptions.RemoveEmptyEntries);
if (pathSpl.Count == 0)
{
pathSpl = new string[] { string.Empty };
}
else
{
for (int i = 0; i < pathSpl.Count; i++)
pathSpl[i] = WebUtility.UrlDecode(pathSpl[i]);
if (pathSpl.Count > 0 && pathSpl[0].Length == 0)
pathSpl = pathSpl.Slice(1);
}
//Execute
response = await Router.GetResponse(req, pathSpl);