Skip to content
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

Conditional response wrapping #112

Open
Dubzer opened this issue Jun 30, 2021 · 1 comment
Open

Conditional response wrapping #112

Dubzer opened this issue Jun 30, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@Dubzer
Copy link

Dubzer commented Jun 30, 2021

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?

@proudmonkey
Copy link
Owner

proudmonkey commented Jun 30, 2021

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! :)

@proudmonkey proudmonkey added the enhancement New feature or request label Jun 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants