-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom header gets cleared #146
Comments
Hi @Kumodoushin! 👋🏻 Can you paste an example request and response? I just want to make sure the response is produced by the problem details middleware. As you've noticed, it's the |
Any updates on this? 😄 |
Thanks. Can I ask where the x-correlation-id is added to the response? What is the order of your middleware? |
The header is added after ProblemDetails - as part of request logging middleware (Serilog with some enricher). public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
app.UseExceptionMiddleware(); //ProblemDetails is wrapped here
app.UseHttpsRedirection();
app.UseDefaultFiles();
app.UseStaticFiles();
app.UseRequestLogging(); //And logging (and adding the header) happens most likely here
app.UseSession();
app.UseRouting();
app.UseIdentityServer();
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
});
} |
In .net 5 webApi project with FluentValidation:
When automatic model validation fails, custom header that was sent in request is cleared.
Would you kindly point out what am I missing?
configuration:
The text was updated successfully, but these errors were encountered: