Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions DebugProbe.AspNetCore/Middleware/DebugProbeMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,19 @@ public async Task Invoke(HttpContext context, DebugEntryStore store)
{
var endpoint = context.GetEndpoint();

var isApiEndpoint =
endpoint?.Metadata.GetMetadata<ControllerActionDescriptor>() is not null;
if (endpoint is null)
{
await _next(context);
return;
}

var path = context.Request.Path.Value ?? string.Empty;

var ignored =
path.StartsWith("/debug") ||
path.StartsWith("/swagger");

if (!isApiEndpoint)
if (ignored)
{
await _next(context);
return;
Expand Down