You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This middleware has options such as IgnoreWrapForOkRequests, ExcludePaths and WrapWhenApiPathStartsWith.
But that still might not be enough. So in my opinion, it would be nice to have some more flexible tool to customize when to use AutoWrapper.
For example, Hellang.Middleware.ProblemDetails has setting IsProblem that accepts Func<HttpContext, bool>. This can cover almost all use cases.
That's how I used it: config.IsProblem = context => context.Response.StatusCode is >= 400 and < 500;
Is it possible to add something like that?
The text was updated successfully, but these errors were encountered:
Thanks @Dubzer! Great suggestion and that's really something that we have to consider adding. I have so much on my plate now and hopefully, when time permits, I can start cleaning up the issues/requests and implement them. My top priority now is to port AW to support .NET 5 and 6. After that, I'll try to implement the suggestions from feedback. So, thank you! :)
This middleware has options such as
IgnoreWrapForOkRequests
,ExcludePaths
andWrapWhenApiPathStartsWith
.But that still might not be enough. So in my opinion, it would be nice to have some more flexible tool to customize when to use AutoWrapper.
For example, Hellang.Middleware.ProblemDetails has setting IsProblem that accepts
Func<HttpContext, bool>
. This can cover almost all use cases.That's how I used it:
config.IsProblem = context => context.Response.StatusCode is >= 400 and < 500;
Is it possible to add something like that?
The text was updated successfully, but these errors were encountered: