37 writes to Url
Aspire.Hosting (13)
ApplicationModel\ResourceUrlAnnotation.cs (1)
46Url = Url,
Dashboard\DashboardEventHandlers.cs (1)
467url.Url = $"{url.Url}/login?t={browserToken}";
Orchestrator\ApplicationOrchestrator.cs (6)
248var url = new ResourceUrlAnnotation { Url = allocatedEndpoint.UriString, Endpoint = endpointReference }; 261Url = $"{allocatedEndpoint.UriScheme}://{endpoint.TargetHost}:{allocatedEndpoint.Port}", 270Url = $"{allocatedEndpoint.UriScheme}://{Environment.MachineName}:{allocatedEndpoint.Port}", 303Url = $"{allocatedEndpoint.UriScheme}://{resource.Name.ToLowerInvariant()}-{subdomainSuffix}.dev.localhost:{allocatedEndpoint.Port}", 418url.Url = uriBuilder.Uri.ToString(); 454url.Url = allocatedEndpoint.UriString.TrimEnd('/') + url.Url;
ProjectResourceBuilderExtensions.cs (2)
617url.Url = launchProfile.LaunchUrl; 623url.Url = (new Uri(baseUri, launchUri)).ToString();
ResourceBuilderExtensions.cs (3)
1230u.Url = uri.ToString(); 1238return builder.WithAnnotation(new ResourceUrlAnnotation { Url = url, DisplayText = displayText }); 1288c.Urls.Add(new() { Endpoint = endpoint, Url = urlValue, DisplayText = displayText });
Aspire.Hosting.DevTunnels (2)
DevTunnelResourceBuilderExtensions.cs (2)
600tunnelUrl.Url = new UriBuilder(tunnelUrl.Url).Uri.ToString().TrimEnd('/'); 627Url = new UriBuilder(portUri) { Host = $"{hostPrefix}-inspect{hostSuffix}" }.Uri.ToString(),
Aspire.Hosting.Qdrant (1)
QdrantBuilderExtensions.cs (1)
98.WithUrlForEndpoint(QdrantServerResource.HttpEndpointName, e => new ResourceUrlAnnotation() { Url = "/dashboard", DisplayText = "Qdrant Dashboard" });
Aspire.Hosting.Tests (17)
Dashboard\DashboardResourceTests.cs (2)
668new() { Url = "http://localhost:5003", Endpoint = ((IResourceWithEndpoints)dashboard).GetEndpoint("http") }, 669new() { Url = "https://localhost:5005", Endpoint = ((IResourceWithEndpoints)dashboard).GetEndpoint("https") }
WithUrlsTests.cs (15)
141.WithUrls(c => c.Urls.Add(new() { Url = "https://example.com", DisplayText = "Example" })) 345u.Url = "https://example.com"; 375.WithUrlForEndpoint("http", u => u.Url = "https://example.com"); 664c.Urls.Add(new() { Url = "http://example.com/", DisplayLocation = UrlDisplayLocation.SummaryAndDetails }); 665c.Urls.Add(new() { Url = "http://example.com/internal", DisplayLocation = UrlDisplayLocation.DetailsOnly }); 666c.Urls.Add(new() { Url = "http://example.com/out-of-range", DisplayLocation = (UrlDisplayLocation)100 }); 731return new() { Url = "https://example.com" }; 757.WithUrls(c => c.Urls.Add(new() { Url = "https://callback-before.com/sub-path", DisplayText = "Example" })) 760.WithUrls(c => c.Urls.Add(new() { Url = "https://callback-after.com/sub-path" })) // This won't get updated because it's added after the relative URL 819url.Url = "/test-sub-path"; 852url.Url = "/test-sub-path"; 858Url = "/test-another-sub-path", 900return new() { Url = "/sub-path" }; 930c.Urls.Add(new() { Endpoint = c.GetEndpoint("test"), Url = "/sub-path" }); 967Url = "/",
Stress.AppHost (1)
Program.cs (1)
98.WithUrls(c => c.Urls.Add(new() { Url = "https://someplace.com", DisplayText = "Some place" }))
TestShop.AppHost (3)
AppHost.cs (3)
57u.Url = "/"; 63Url = "/swagger", 89.WithUrlForEndpoint("https", ep => new() { Url = "/health", DisplayText = "Health", DisplayLocation = UrlDisplayLocation.DetailsOnly })
70 references to Url
Aspire.Hosting (25)
ApplicationModel\ResourceUrlAnnotation.cs (1)
46Url = Url,
Dashboard\DashboardEventHandlers.cs (1)
467url.Url = $"{url.Url}/login?t={browserToken}";
Dcp\ResourceSnapshotBuilder.cs (3)
274Url: endpointUrl.Url, 302new(Name: endpointName, Url: endpointUrl.Url, IsInternal: endpointUrl.IsInternal) 313new(Name: null, Url: url.Url, IsInternal: url.IsInternal)
Orchestrator\ApplicationOrchestrator.cs (18)
155urls = resourceUrls.Select(url => new UrlSnapshot(Name: url.Endpoint?.EndpointName, Url: url.Url, IsInternal: url.DisplayLocation == UrlDisplayLocation.DetailsOnly) 329_logger.LogTrace("Added URL '{Url}' for endpoint '{EndpointName}' on resource '{ResourceName}'.", url.Url, endpoint.Name, resource.Name); 336_logger.LogTrace("Added additional URL '{Url}' for endpoint '{EndpointName}' on resource '{ResourceName}'.", additionalUrl.Url, endpoint.Name, resource.Name); 350_logger.LogTrace("Added static URL '{Url}' for resource '{ResourceName}'.", staticUrl.Url, resource.Name); 397Uri.TryCreate(primaryUrl.Url, UriKind.RelativeOrAbsolute, out var primaryUri); 398var primaryPath = primaryUri?.IsAbsoluteUri == true ? primaryUri.AbsolutePath : primaryUrl.Url; 405_logger.LogTrace("Applying path '{Path}' from URL '{Url}' for primary launch profile endpoint '{EndpointName}' to other launch profile endpoints for resource '{ResourceName}'.", primaryPath, primaryUrl.Url, primaryLaunchProfileEndpoint.Name, resource.Name); 410&& !string.Equals(url.Url, primaryUrl.Url, StringComparisons.Url) 411&& Uri.IsWellFormedUriString(url.Url, UriKind.Absolute)) 415_logger.LogTrace("Updating URL '{Url}' with path '{Path}' for launch profile endpoint '{EndpointName}' for resource '{ResourceName}'.", url.Url, primaryPath, url.Endpoint.EndpointName, resource.Name); 417var uriBuilder = new UriBuilder(url.Url) { Path = primaryPath }; 421_logger.LogTrace("Updated URL to '{Url}' for launch profile endpoint '{EndpointName}' on resource '{ResourceName}'.", url.Url, url.Endpoint.EndpointName, resource.Name); 430_logger.LogTrace("URL '{Url}' for primary launch profile endpoint '{EndpointName}' for resource '{ResourceName}' does not have a path to apply to other launch profile endpoints.", primaryUrl.Url, primaryLaunchProfileEndpoint.Name, resource.Name); 452if (url.Url.StartsWith('/') && endpoint.AllocatedEndpoint is { } allocatedEndpoint) 454url.Url = allocatedEndpoint.UriString.TrimEnd('/') + url.Url; 457_logger.LogTrace("Converted relative URL to absolute URL '{Url}' for endpoint '{EndpointName}' on resource '{ResourceName}'.", url.Url, endpoint.EndpointName, resource.Name); 471_logger.LogTrace("Added URL annotation '{Url}' to resource '{ResourceName}'.", url.Url, resource.Name);
ProjectResourceBuilderExtensions.cs (1)
622var baseUri = new Uri(url.Url);
ResourceBuilderExtensions.cs (1)
1227if (Uri.TryCreate(u.Url, UriKind.Absolute, out var absoluteUri)
Aspire.Hosting.DevTunnels (3)
DevTunnelResourceBuilderExtensions.cs (3)
598&& !string.Equals(new UriBuilder(u.Url).Host, "localhost")) is { } tunnelUrl) 600tunnelUrl.Url = new UriBuilder(tunnelUrl.Url).Uri.ToString().TrimEnd('/'); 606&& string.Equals(new UriBuilder(u.Url).Host, "localhost", StringComparison.OrdinalIgnoreCase)) is { } localhostTunnelUrl)
Aspire.Hosting.Qdrant.Tests (1)
QdrantFunctionalTests.cs (1)
248Assert.Single(urls, u => u.DisplayText == "Qdrant Dashboard" && u.Url.EndsWith("/dashboard"));
Aspire.Hosting.Tests (41)
Dashboard\DashboardResourceTests.cs (2)
684Assert.Equal(expectedHttpUrl, httpUrl.Url); 688Assert.Equal(expectedHttpsUrl, httpsUrl.Url);
WithEndpointTests.cs (4)
619url => Assert.StartsWith("https://example.localhost:", url.Url), 620url => Assert.StartsWith("https://localhost:", url.Url)); 653url => Assert.StartsWith("https://localhost:", url.Url), 654url => Assert.StartsWith($"https://{Environment.MachineName}:", url.Url));
WithUrlsTests.cs (35)
153Assert.Single(urls, u => u.Url == "https://example.com" && u.DisplayText == "Example"); 177Assert.Single(urls, u => u.Url == "https://example.com" && u.DisplayText == "Example"); 205u => Assert.True(u.Url == endpointUrl.Url && u.DisplayText is null), 206u => Assert.True(u.Url.EndsWith("/test") && u.DisplayText == "Example") 231Assert.Single(urls, u => u.Url.StartsWith("http://localhost") && u.Endpoint?.EndpointName == "test"); 267Assert.StartsWith($"http://{projectB.Resource.Name.ToLowerInvariant()}{expectedHostSuffix}", u.Url); 268Assert.EndsWith("/sub-path", u.Url); 275Assert.StartsWith("http://localhost", u.Url); 281Assert.StartsWith("tcp://localhost", u.Url); 307Assert.Single(urls, u => u.Url.EndsWith("/sub-path") && u.Endpoint?.EndpointName == "http"); 330Assert.Single(urls, u => u.Url == "http://custom.localhost:23456/home" && u.Endpoint?.EndpointName == "http"); 361u.Url == "https://example.com" 773var staticBeforeUrl = allUrls.FirstOrDefault(u => u.Endpoint is null && u.Url.StartsWith("https://static-before.com")); 774var callbackBeforeUrl = allUrls.FirstOrDefault(u => u.Endpoint is null && u.Url.StartsWith("https://callback-before.com")); 775var staticAfter = allUrls.FirstOrDefault(u => u.Endpoint is null && u.Url.StartsWith("https://static-after.com")); 776var callbackAfter = allUrls.FirstOrDefault(u => u.Endpoint is null && u.Url.StartsWith("https://callback-after.com")); 780Assert.True(endpointUrl.Url.StartsWith("http://localhost") && endpointUrl.Url.EndsWith("/test")); 783Assert.Equal("https://static-before.com/test", staticBeforeUrl.Url); 786Assert.Equal("https://callback-before.com/test", callbackBeforeUrl.Url); 789Assert.Equal("https://static-after.com/test", staticAfter.Url); 792Assert.Equal("https://callback-after.com/sub-path", callbackAfter.Url); 835Assert.StartsWith(useHttps ? "https://localhost" : "http://localhost", endpointUrl.Url); 836Assert.EndsWith("/test-sub-path", endpointUrl.Url); 875Assert.StartsWith("http://localhost", url.Url); 876Assert.EndsWith("/test-sub-path", url.Url); 881Assert.StartsWith("http://localhost", url.Url); 882Assert.EndsWith("/test-another-sub-path", url.Url); 912var endpointUrl = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>().FirstOrDefault(u => u.Endpoint?.EndpointName == "test" && u.Url.EndsWith("/sub-path")); 915Assert.True(endpointUrl.Url.StartsWith("http://localhost") && endpointUrl.Url.EndsWith("/sub-path")); 942var endpointUrl = projectA.Resource.Annotations.OfType<ResourceUrlAnnotation>().FirstOrDefault(u => u.Endpoint?.EndpointName == "test" && u.Url.EndsWith("/sub-path")); 945Assert.True(endpointUrl.Url.StartsWith("http://localhost") && endpointUrl.Url.EndsWith("/sub-path"));