-
Notifications
You must be signed in to change notification settings - Fork 6
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 request that exceeded limit with TooManyRequestsRejection
#5
base: master
Are you sure you want to change the base?
Conversation
…jection instead of responding with complete directive.
@unoexperto The idea is interesting. I do think that the default behavior should be for library to handle it and make it as transparent to developer as possible. On other end I'm all for allowing dev to have control when needed. There is There is also ConfigMetricThrottleSettings.scala where the settings can be injected from typesafe config. Let me know what you think |
Reject request that exceeded limit with
TooManyRequestsRejection
rejection instead of responding with complete directive. Rationale is to allow developer to respond with body he/she wants (in custom rejection handler) instead of hardcoding text-only response.Downside of this method is that there is no default handler for this rejection similarly to handler for
TooManyRangesRejection
for example. So if library user doesn't implement handler forTooManyRequestsRejection
http client will get 500 error.For example in my case all rejections are wrapped into json response that mobile client understands.