fix: remove the latest api

This commit is contained in:
Polianin Nikita 2024-11-04 02:34:50 +03:00
parent dbd9e1a070
commit 6b5eda7756

View File

@ -30,13 +30,8 @@ public static class UrlHelper
var parts = path.Split('/', StringSplitOptions.RemoveEmptyEntries); var parts = path.Split('/', StringSplitOptions.RemoveEmptyEntries);
for (int i = 0; i < parts.Length; i++) if (parts[^1].Equals("api", StringComparison.CurrentCultureIgnoreCase))
{ parts = parts.Take(parts.Length - 1).ToArray();
if (!parts[i].Equals("api", StringComparison.CurrentCultureIgnoreCase)) continue;
parts = parts.Take(i).Concat(parts.Skip(i + 1)).ToArray();
break;
}
return CreateSubPath(string.Join("/", parts)); return CreateSubPath(string.Join("/", parts));
} }