From 6b5eda77565d5095eb4c2e39087894ac6cc1ac51 Mon Sep 17 00:00:00 2001 From: Polianin Nikita Date: Mon, 4 Nov 2024 02:34:50 +0300 Subject: [PATCH] fix: remove the latest api --- Endpoint/Common/Services/UrlHelper.cs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Endpoint/Common/Services/UrlHelper.cs b/Endpoint/Common/Services/UrlHelper.cs index a8ecbd7..9769a25 100644 --- a/Endpoint/Common/Services/UrlHelper.cs +++ b/Endpoint/Common/Services/UrlHelper.cs @@ -30,13 +30,8 @@ public static class UrlHelper var parts = path.Split('/', StringSplitOptions.RemoveEmptyEntries); - for (int i = 0; i < parts.Length; i++) - { - if (!parts[i].Equals("api", StringComparison.CurrentCultureIgnoreCase)) continue; - - parts = parts.Take(i).Concat(parts.Skip(i + 1)).ToArray(); - break; - } + if (parts[^1].Equals("api", StringComparison.CurrentCultureIgnoreCase)) + parts = parts.Take(parts.Length - 1).ToArray(); return CreateSubPath(string.Join("/", parts)); }