Replace static parameters in route pattern for telemetry - #2
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4404a33d5d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| var result = string.Join(SeparatorString, segments); | ||
|
|
||
| // Preserve leading slash from raw text | ||
| if (pattern.RawText is { Length: > 0 } rt && rt[0] == Separator) | ||
| { |
There was a problem hiding this comment.
Preserve trailing slash when rebuilding debug string
When a template has required values, Format rebuilds the route string from PathSegments and only re-adds a leading slash. This drops a trailing slash that was present in RawText (e.g., a template like "/{controller}/" with required values will become "/Home" instead of "/Home/"). Trailing slashes are significant in routing and are preserved in RawText, so losing them changes IRouteDiagnosticsMetadata/display names and can conflate /foo with /foo/ in telemetry and diagnostics. Consider appending a trailing separator when RawText ends with /.
Useful? React with 👍 / 👎.
Benchmark PR from qodo-benchmark#20