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

Reject with other status code? #64

Closed
osmarks opened this issue Aug 19, 2018 · 2 comments
Closed

Reject with other status code? #64

osmarks opened this issue Aug 19, 2018 · 2 comments

Comments

@osmarks
Copy link

osmarks commented Aug 19, 2018

I'd like to be able to reject requests with status codes currently not available, like 401 Unauthorized; is this possible?

@algermissen
Copy link
Contributor

You might want to read my #62

In my understanding (having a little Akka background), rejections are not meant for error responses. Yes, rejections work with status codes and lead to responses, but in the case of 401 for example, we do not want to reject, but respond with a 401 response. IOW, we do not want a filter down the chain to recover the rejection. It is the protocol to return 401.

@seanmonstar
Copy link
Owner

It's just as @algermissen described, especially with the changes coming in #115. Any customizing of rejections should be done via Filter::recover, and returning a new Reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants