diff --git a/dotnet/aspire-integration/Aspire.Hosting.AgentFramework.DevUI/DevUIAggregatorHostedService.cs b/dotnet/aspire-integration/Aspire.Hosting.AgentFramework.DevUI/DevUIAggregatorHostedService.cs index 0c93337c4f..ba8dc38db4 100644 --- a/dotnet/aspire-integration/Aspire.Hosting.AgentFramework.DevUI/DevUIAggregatorHostedService.cs +++ b/dotnet/aspire-integration/Aspire.Hosting.AgentFramework.DevUI/DevUIAggregatorHostedService.cs @@ -177,12 +177,10 @@ internal sealed class DevUIAggregatorHostedService : IAsyncDisposable } // SPA fallback: serve index.html for paths without a file extension (client-side routing) - if (!resourcePath.Contains('.', StringComparison.Ordinal)) + if (!resourcePath.Contains('.', StringComparison.Ordinal) && + await this.TryServeResourceAsync(context, "index.html").ConfigureAwait(false)) { - if (await this.TryServeResourceAsync(context, "index.html").ConfigureAwait(false)) - { - return; - } + return; } context.Response.StatusCode = StatusCodes.Status404NotFound;