Fix path excluding symbols that are used in requests

This commit is contained in:
Glax 2024-04-21 21:46:52 +02:00
parent 4cb7c941a2
commit 4104169c19

View File

@ -112,7 +112,7 @@ public partial class Server : GlobalBase, IDisposable
SendResponse(HttpStatusCode.OK, context.Response); //Response always contains all valid Request-Methods
if (request.Url!.LocalPath.Contains("favicon"))
SendResponse(HttpStatusCode.NoContent, response);
string path = Regex.Match(request.Url.LocalPath, @"\/[A-z0-9]+(\/[A-z0-9]+)*").Value; //Local Path
string path = Regex.Match(request.Url.LocalPath, @"\/[a-zA-Z0-9\.+/=-]+(\/[a-zA-Z0-9\.+/=-]+)*").Value; //Local Path
if (!Regex.IsMatch(path, "/v2(/.*)?")) //Use only v2 API
{