From a84503599e20a9018955cb7cfd6814c0593e7a24 Mon Sep 17 00:00:00 2001 From: Jah-yee <166608075+Jah-yee@users.noreply.github.com> Date: Sun, 17 May 2026 15:54:36 +0800 Subject: [PATCH] fix: capture 404 requests in middleware Remove the early return when context.GetEndpoint() is null, so that 404 Not Found requests are captured by the middleware instead of being skipped. This aligns with the expected behavior: debugging missing routes is a common scenario and developers need visibility into invalid requests. Fixes DebugProbe/DebugProbe.AspNetCore#53 Signed-off-by: Jah-yee --- DebugProbe.AspNetCore/Middleware/DebugProbeMiddleware.cs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/DebugProbe.AspNetCore/Middleware/DebugProbeMiddleware.cs b/DebugProbe.AspNetCore/Middleware/DebugProbeMiddleware.cs index db9b9fb..464ca93 100644 --- a/DebugProbe.AspNetCore/Middleware/DebugProbeMiddleware.cs +++ b/DebugProbe.AspNetCore/Middleware/DebugProbeMiddleware.cs @@ -35,14 +35,6 @@ public DebugProbeMiddleware(RequestDelegate next, DebugProbeOptions options) public async Task Invoke(HttpContext context, DebugEntryStore store) { - var endpoint = context.GetEndpoint(); - - if (endpoint is null) - { - await _next(context); - return; - } - var path = context.Request.Path.Value ?? string.Empty; var ignored =