Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Set 'Retry-After' header when throwing error #63

Merged

Conversation

mgrandrath
Copy link

This change sets the 'Retry-After' response header when throwing the 429 error (i.e. the throw option is set to true). Previously this was not the case because Koa's default error handler unsets all response headers before setting those specified in the error object.

I had to change the error handling in the tests because catching and handling the error bypassed Koa's error handler.

Please let me know if you have questions or suggestions

This change sets the 'Retry-After' response header when throwing the
429 error (i.e. the `throw` option is set to `true`). Previously this
was not the case because Koa's default error handler unsets all
response headers before setting those specified in the error object.
@titanism titanism merged commit f366504 into koajs:master Dec 6, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants