Skip to content

fix: improve ignore path matching to prevent false positives #120

Merged
georgidhristov merged 1 commit into
DebugProbe:mainfrom
viogustian:fix/ignore-path-matching
Jun 12, 2026
Merged

fix: improve ignore path matching to prevent false positives #120
georgidhristov merged 1 commit into
DebugProbe:mainfrom
viogustian:fix/ignore-path-matching

Conversation

@viogustian

@viogustian viogustian commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

closes #116

Problem

The current implementation uses a raw .StartsWith() check for ignored paths. This causes unrelated endpoints that happen to share the same prefix to be incorrectly ignored when a base path is configured.

Solution

Updated IsIgnoredPath in DebugProbeMiddleware to use boundary-aware matching. The logic now strictly checks for an exact match (path.Equals) or a valid child path by appending a trailing slash (path.StartsWith(ignorePath.TrimEnd('/') + "/")).

Testing

  • Reproduced the bug where /healthcare was incorrectly dropped when /health was ignored.
  • Added a unit test (Similar_paths_are_not_skipped) in MiddlewareExecutionFlowTests to verify similar but distinct paths are recorded correctly.
  • All tests pass successfully.

@georgidhristov georgidhristov merged commit 235b047 into DebugProbe:main Jun 12, 2026
1 check passed
@georgidhristov

Copy link
Copy Markdown
Collaborator

Tested locally with configured ignore paths.

Verified that exact matches and child paths are ignored correctly, while similar paths such as /healthcare continue to be captured.

Thanks for the contribution. I really appreciate your help improving DebugProbe and taking the time to work on these issues.

Feel free to pick up more issues in the future if something looks interesting to you. Contributions are always welcome.

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.

Improve Ignore Path Matching to Avoid False Positives

2 participants