| 1 | namespace CascadeIDE.Features.Forge.Infrastructure; |
| 2 | |
| 3 | internal static class ForgeLensHostUrl |
| 4 | { |
| 5 | internal static string NormalizeKey(string baseUrl) |
| 6 | { |
| 7 | if (!Uri.TryCreate(baseUrl.Trim(), UriKind.Absolute, out var uri)) |
| 8 | throw new ArgumentException("Forge base URL must be absolute.", nameof(baseUrl)); |
| 9 | |
| 10 | return uri.GetLeftPart(UriPartial.Authority).TrimEnd('/').ToLowerInvariant(); |
| 11 | } |
| 12 | } |
| 13 |