Skip to content

fix: capture 404 requests in middleware#54

Merged
georgidhristov merged 1 commit into
DebugProbe:mainfrom
Jah-yee:fix/404-capture
May 17, 2026
Merged

fix: capture 404 requests in middleware#54
georgidhristov merged 1 commit into
DebugProbe:mainfrom
Jah-yee:fix/404-capture

Conversation

@Jah-yee
Copy link
Copy Markdown
Contributor

@Jah-yee Jah-yee commented May 17, 2026

Description

Remove the early return when context.GetEndpoint() is null, so that 404 Not Found requests are captured by the middleware instead of being skipped.

Changes

Removed the following block from DebugProbeMiddleware.cs (8 lines):

var endpoint = context.GetEndpoint();

if (endpoint is null)
{
    await _next(context);
    return;
}

Why

  • Debugging missing routes is a common scenario
  • Developers often need visibility into invalid requests
  • Monitoring unexpected traffic is useful
  • APIs frequently receive malformed or outdated routes

Fixes #53

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#53
Signed-off-by: Jah-yee <jydu_seven@outlook.com>
@georgidhristov
Copy link
Copy Markdown
Collaborator

Thanks for the contribution.

@georgidhristov georgidhristov merged commit b54ac7b into DebugProbe:main May 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

404 Not Found Requests Are Not Captured By Middleware

2 participants