Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

HTTP logging truncates catch-all route parameters in the formatted request path

Open Beginner friendly
#7,883 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@johnkaram02 is already working on this.

Since Oct 23, 2026.

  • #7884 by @johnkaram02 — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
csharp
Domain
backend

Research direction

Start by reading HttpRouteFormatter.Format and compare its catch-all handling with HttpRouteParser.TryExtractParameters, which the issue says already handles this case. Use the unit-level reproduction in the issue to check formatted output for {*path} and {**path}. Done means the formatter preserves all remaining path segments and produces the expected redacted path.

Written by the indexing model from the issue text.

Description

area-telemetry untriaged
Description

When HTTP logging uses the formatted path mode, which is the default (IncomingPathLoggingMode.Formatted for AddHttpLoggingRedaction and OutgoingPathLoggingMode.Formatted for AddExtendedHttpClientLogging), the request path is built by the internal HttpRouteFormatter. For a route with a catch-all parameter such as {*path} or {**path}, the formatter takes only the first path segment of the value and drops the rest of the path.

#5466 fixed the same problem in HttpRouteParser.TryExtractParameters, which the structured path mode uses. HttpRouteFormatter.Format still ignores Segment.IsCatchAll.

As a result:

  • A redactor receives only the first segment, so files/a/1 and files/a/2 produce the same redacted value.
  • When the catch-all parameter isn't redacted, the logged path is cut short (for example, api/[REDACTED]/files/a instead of api/[REDACTED]/files/a/b/c).
Reproduction steps

Unit-level repro against the internal formatter, using the FakeRedactorProvider from Microsoft.Extensions.Compliance.Testing:

var redactorProvider = new FakeRedactorProvider(new FakeRedactorOptions { RedactionFormat = "Redacted:{0}" });
var formatter = new HttpRouteFormatter(new HttpRouteParser(redactorProvider), redactorProvider);

var parametersToRedact = new Dictionary<string, DataClassification>
{
    { "userId", FakeTaxonomy.PrivateData },
    { "path", FakeTaxonomy.PrivateData },
};

formatter.Format("api/{userId}/files/{*path}", "api/user1/files/a/b/c", HttpRouteParameterRedactionMode.Strict, parametersToRedact);

From the code, an ASP.NET Core app that maps app.MapGet("/api/{userId}/files/{*path}", ...) and calls AddHttpLoggingRedaction() goes through the same formatter. I reproduced it with the unit-level example above, not in a running app.

Expected behavior

api/Redacted:user1/files/Redacted:a/b/c

Actual behavior

api/Redacted:user1/files/Redacted:a

Regression?

No.

Known workarounds

From the code, setting RequestPathLoggingMode to Structured should avoid it, since that mode uses HttpRouteParser, which handles catch-all parameters.

Configuration

Current main, .NET 10. Found by reading the code and confirmed with a unit test.

Other information

The formatter can apply the same rule the parser already uses: a catch-all parameter takes the rest of the path.

Dominant language
C#
Stars
3.3k
Forks
914
Avg merge
2d 7h
Merged PRs (30d)
42

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dotnet/extensions

All issues in dotnet/extensions

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.