You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 27, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Oct 27, 2026. It is now read-only.
[Bug Report]: Web UI is trying to handle resources that do not belong to it #150
I have searched issues to ensure it has not already been reported
Description
When performing an HTTP request to another middleware (in this case, it happened requesting to a resource owned by the KafkaFlow middleware), the Rules.Framework Web UI tries to handle it and fails with an exception.
Steps to reproduce
Register Web UI middleware.
Register other middlewares after.
Run the app.
Perform a request that is supposed to be handled by other middleware.
Expected behavior
The Web UI should not try to handle resources that are not its' responsibility.
Actual behavior
When trying to access another resource that does not belong to Rules.Framework Web UI (from KafkaFlow UI in this case), an exception is thrown:
System.InvalidOperationException: StatusCode cannot be set because the response has already started.
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ThrowResponseAlreadyStartedException(String value)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.Microsoft.AspNetCore.Http.Features.IHttpResponseFeature.set_StatusCode(Int32 value)
at KafkaFlow.Admin.Dashboard.ApplicationBuilderExtensions.<>c__DisplayClass1_2.<<UseKafkaFlowDashboard>b__11>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.InvokeCore(HttpContext context, String matchedPath, String remainingPath)
at Rules.Framework.WebUI.WebUIMiddleware.InvokeAsync(HttpContext httpContext)
at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
at Farfetch.Framework.PingPong.AspNetCore.PingPongMiddleware.Invoke(HttpContext httpContext)
at Farfetch.Framework.PingPong.AspNetCore.PingPongMiddleware.Invoke(HttpContext httpContext)
at Farfetch.Framework.PingPong.AspNetCore.PingPongMiddleware.Invoke(HttpContext httpContext)
at Prometheus.HttpMetrics.HttpInProgressMiddleware.Invoke(HttpContext context)
at Farfetch.Framework.Monitoring.WebMetrics.AspNetCore.Middlewares.HttpRequestDurationMiddleware.Invoke(HttpContext context)
at Farfetch.Framework.Monitoring.WebMetrics.AspNetCore.Middlewares.HttpRequestCountMiddleware.Invoke(HttpContext context)
at NewRelic.Providers.Wrapper.AspNetCore.WrapPipelineMiddleware.Invoke(HttpContext context)
Activity
luispfgarces commentedon Jul 21, 2023
Proposed solution:
nextmiddleware toInvokeAsync.StaticFileMiddlewareconfiguration.We can change the
StaticFileMiddlewareconfiguration like this:But we have to check other files in the Web UI that are using static files and include the
/rules-staticresource segment.