Description
DebugProbe currently uses StartsWith when evaluating ignored paths.
This can cause unrelated endpoints to be ignored when their route begins with an ignored path value.
Current Behavior
If the following path is configured:
builder.Services.AddDebugProbe(options =>
{
options.IgnorePaths =
[
"/health"
];
});
The following requests are ignored:
/health
/health/
/health/status
But these are also ignored:
/healthcare
/health-checks
/healthy
even though they are unrelated endpoints.
Expected Behavior
Ignore path matching should only match:
- exact path matches
- valid child paths beneath the configured path
For example, configuring:
should ignore:
/health
/health/
/health/status
but should not ignore:
/healthcare
/health-checks
/healthy
Suggested Fix
Replace the current StartsWith matching with boundary-aware path matching.
Recommended logic:
- Match when the request path equals the ignored path.
- Match when the request path starts with the ignored path followed by
/.
- Do not match partial route prefixes.
Result
After this change:
- Ignore path behavior becomes more predictable.
- Unrelated endpoints are no longer excluded accidentally.
- Health, readiness, and liveness endpoints continue to work as expected.
- Route matching aligns more closely with developer expectations.
Description
DebugProbe currently uses
StartsWithwhen evaluating ignored paths.This can cause unrelated endpoints to be ignored when their route begins with an ignored path value.
Current Behavior
If the following path is configured:
The following requests are ignored:
But these are also ignored:
even though they are unrelated endpoints.
Expected Behavior
Ignore path matching should only match:
For example, configuring:
should ignore:
but should not ignore:
Suggested Fix
Replace the current
StartsWithmatching with boundary-aware path matching.Recommended logic:
/.Result
After this change: