fix: improve ignore path matching to prevent false positives #120
Merged
georgidhristov merged 1 commit intoJun 12, 2026
Conversation
Collaborator
|
Tested locally with configured ignore paths. Verified that exact matches and child paths are ignored correctly, while similar paths such as 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
IsIgnoredPathinDebugProbeMiddlewareto 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
/healthcarewas incorrectly dropped when/healthwas ignored.Similar_paths_are_not_skipped) inMiddlewareExecutionFlowTeststo verify similar but distinct paths are recorded correctly.