-
-
Notifications
You must be signed in to change notification settings - Fork 70
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
Update errorResponseBuilderContext type with ban property #298
Conversation
Not entirely sure why all those tests are failing, but I don't understand how it could be from my change to the types |
It is due to this PR: fastify/light-my-request#248 We need to update the comparisons |
can't update the branch tho |
@leonitousconforti could you add a test here https://github.com/fastify/fastify-rate-limit/blob/master/types/index.test-d.ts too? |
Had request.ip instead of req.ip
Let me know what you think about the changes to the tests |
Add limit back
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
According to the README:
When the ban limit is exceeded the context field will have ban=true in the errorResponseBuilder.
This just updates the types to reflect that. I have been using the field and it works as expected, just updating the types so I don't have to use a ts-ignore commentChecklist
runnot needed?npm run test
andnpm run benchmark
documentation is changed or addeddocumentation is already correctand the Code of conduct