From 947c2b84c62eaaba606d2f956b8fc8348e2acc36 Mon Sep 17 00:00:00 2001 From: Pupchansky Date: Wed, 9 Oct 2024 21:12:59 +0500 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81=20parametrizedHandler-?= =?UTF-8?q?=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Administration/ServerApi.Utility.cs | 16 +++++++++++++--- Tools/publish_github_artifact.py | 2 +- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Content.Server/Administration/ServerApi.Utility.cs b/Content.Server/Administration/ServerApi.Utility.cs index d2031599db..538e2ce327 100644 --- a/Content.Server/Administration/ServerApi.Utility.cs +++ b/Content.Server/Administration/ServerApi.Utility.cs @@ -64,13 +64,13 @@ public sealed partial class ServerApi { var absolute_path = context.Url.AbsolutePath; - if (context.RequestMethod != method) + if (context.RequestMethod != method || !CheckPathes(absolute_path)) return false; if (!await CheckAccess(context)) return true; - var formatted_maps = CheckPathes(absolute_path, exactPath); + var formatted_maps = GetMapArguments(absolute_path, exactPath); if (formatted_maps.Count == 0) return true; @@ -79,7 +79,17 @@ public sealed partial class ServerApi }); } - private static Dictionary CheckPathes(string realPath, string predictedPath) + private static bool CheckPathes(string realPath) + { + var search_regex = ParametrSearchRegex(); + + if (search_regex.IsMatch(realPath)) + return true; + + return false; + } + + private static Dictionary GetMapArguments(string realPath, string predictedPath) { var search_regex = ParametrSearchRegex(); diff --git a/Tools/publish_github_artifact.py b/Tools/publish_github_artifact.py index e234b03021..3a020bbd90 100755 --- a/Tools/publish_github_artifact.py +++ b/Tools/publish_github_artifact.py @@ -48,7 +48,7 @@ def get_artifact_url() -> str: return resp.headers["Location"] def get_engine_version() -> str: - return "235.0.0" + return "236.0.0" if __name__ == '__main__':