Invalid TraceId field in the ProblemDetails response
See original GitHub issueHi!
I’m using ASP.NET Core 3.0 with the last version of Hellang.Middleware.ProblemDetails (3.1.0). In my Startup.ConfigureServices method I have added the following line:
services.AddProblemDetails();
And the corresponding
app.UseProblemDetails();
At the beginning of the Configure method.
With this setup, I have noticed that the output is something like this:
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "Bad Request",
"status": 400,
"traceId": "|ce3cd73b-4af1db1e8a67d40f."
}
In particular, you can note that the traceId field seems to be invalid. Can you please investigate on this behavior?
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
How I can adjust which fields I will have in the response ...
Now validation response looks like: { "status": 400, "errors": { "name": [ "The Name field is required." ] } } No traceId ,...
Read more >How I can adjust which fields I will have in the response ...
Hi, I have the following response when there is a validation ... How to remove for each response the fields: type , title...
Read more >Beware of potential XSS injections when using ...
The default behaviour of ProblemDetails in ASP.NET Core does not escape the user input, this can lead to XSS injections.
Read more >Problem Details for Better REST HTTP API Errors
Do you wish there was a standard way to return errors from a REST HTTP API? There is, it's called Problem Details. Here's...
Read more >Problem Details responses everywhere with ASP.NET ...
It was possible to return the Problem Details response manually, or the framework could generate it automatically in several specific cases.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In this case, it looks very much like the format of an Activity ID; https://github.com/dotnet/corefx/blob/master/src/System.Diagnostics.DiagnosticSource/src/ActivityUserGuide.md#id-format.
It depends on where your request is coming from and whether it includes a
Request-Id
or aCorrelation-Context
header, I think.Activity also supports different formats, where “hierarchical” is the default. See https://github.com/dotnet/corefx/blob/master/src/System.Diagnostics.DiagnosticSource/src/HierarchicalRequestId.md.