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

Add SetStatus #248

Merged
merged 2 commits into from Apr 24, 2022
Merged

Add SetStatus #248

merged 2 commits into from Apr 24, 2022

Conversation

davidpdrsn
Copy link
Member

For #243 I think it would be good to have an easy way to control the fallback's status code. I imagine you'll often want it to be 404 even if the fallback returns 200, to maintain the fact that the response was a "not found".

This add SetStatus which overrides the status code from the inner service.

Once this is merged I'll update #243 to have convenience methods to add a fallback and apply SetStatus::layer(NOT_FOUND).

@davidpdrsn davidpdrsn added the A-new-middleware Area: new middleware proposals label Apr 24, 2022
@davidpdrsn davidpdrsn requested a review from jplatte April 24, 2022 12:36
@davidpdrsn davidpdrsn mentioned this pull request Apr 24, 2022
4 tasks
@davidpdrsn davidpdrsn requested a review from Nehliin April 24, 2022 12:40
@davidpdrsn davidpdrsn merged commit fd13e2a into master Apr 24, 2022
@davidpdrsn davidpdrsn deleted the set-status branch April 24, 2022 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-new-middleware Area: new middleware proposals
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants