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)); }