// Returns the canonical URL for a given path
private static string GetCanonicalUrl(string path)
{
var uri = new Uri(NavigationManager.Uri);
// Use Authority instead of Host to include port if present
return $"{uri.Scheme}://{uri.Authority}{path}";
}