Skip to content

9.2: Relative urls to WithUrlForEndpoint get swallowed #8636

@afscrome

Description

@afscrome

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

If you pass a relative url to WithUrlForEndpoint, then no URLs get shown for the resource.

.WithUrlForEndpoint("http", annotation => annotation.Url = "/swagger")

Expected Behavior

Preferably, the relative url would be combined with the endpoint's url - i.e. equivalent to .WithUrlForEndpoint("http", annotation => annotation.Url = $"{annotation.Endpoint?.Url}/swagger"). Likely using new Uri(Uri baseUri, string? relativeUri) to combine the base url and the relative portion.

Alternatively if an absolute url is required, I'd expect to see some kind of error logged.

Steps To Reproduce

.WithUrlForEndpoint("http", annotation => annotation.Url = "/swagger")

Exceptions (if any)

None

.NET Version info

No response

Anything else?

cc @DamianEdwards

Metadata

Metadata

Assignees

Labels

area-app-modelIssues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions