Skip to content

[BUG]: Multiple URL entries in WithUrlsToWatch results in zero watched URLs #1648

@alexthissen

Description

@alexthissen

Description

In an Aspire 13.* project, the DevProxyResourceBuilderExtensions.WithUrlsToWatch extension method accepts an array of strings for watched multiple URLs. When providing more than one URL, none of the URLs are actually being watched.
If there is exactly one URL string value, the DevProxy does watch that single endpoint.

Working setup:

var devProxy = builder.AddDevProxyExecutable("devproxy")
    .WithConfigFile("../../.devproxy/devproxyrc-aspire.json")
    .WithUrlsToWatch(() => [
        $"{myApi.GetEndpoint("https").Url}/*" // Single URL works
    ]);

Expected behaviour

When providing multiple URLs to WithUrlsToWatch all URL endpoints should be watched.

Actual behaviour

None are watched.

Steps to reproduce

Reproduction setup during Aspire AppHost startup in Program.cs:

var devProxy = builder.AddDevProxyExecutable("devproxy")
    .WithConfigFile("../../.devproxy/devproxyrc-aspire.json")
    .WithUrlsToWatch(() => [
        $"{myApi.GetEndpoint("http").Url}/*",
        $"{myApi.GetEndpoint("https").Url}/*"
    ]);

Dev Proxy Version

2.4.0

Operating system (environment)

Linux

Shell

bash

Configuration file

N/A

Additional Info

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions