Repository navigation
Fix duplicate separator in HTTP logging - #7749
Merged
evgenyfedorov2 merged 2 commits intoSep 11, 2026
Merged
evgenyfedorov2 merged 2 commits into
evgenyfedorov2 merged 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
ðĒ Approval recommended
The change is narrowly scoped, matches the reported behavior, and includes a targeted regression test for the failing scenario.
Pull request overview
Fixes an HTTP client logging formatting bug where the rendered message could include a duplicated / between host and path when path redaction is disabled, while keeping the structured logging tags unchanged.
Changes:
- Adjusts the outgoing-request original-format message to conditionally add a
/only when the logged path doesnât already start with/. - Adds a regression test covering
RequestPathParameterRedactionMode = Noneto ensure the rendered message doesnât duplicate the separator.
File summaries
| File | Description |
|---|---|
| test/Libraries/Microsoft.Extensions.Http.Diagnostics.Tests/Logging/HttpClientLoggerTest.cs | Adds a regression test validating unredacted path formatting does not produce a double slash. |
| src/Libraries/Microsoft.Extensions.Http.Diagnostics/Logging/Internal/Log.cs | Updates the message formatter to avoid inserting an extra / when the path already begins with /. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
ðĄ Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Contributor
Author
|
@dotnet-policy-service agree |
evgenyfedorov2
approved these changes
Sep 11, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes #7737
When path redaction is disabled,
RequestUri.AbsolutePathalready begins with/. The outgoing request formatter was adding another separator, producing messages such asGET github.com//dotnet/extensions.Use a separator only when the logged path does not already start with
/, while leaving the structuredurl.pathvalue unchanged. The regression test covers the unredacted path mode.Microsoft Reviewers: Open in CodeFlow