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

Update errorResponseBuilderContext type with ban property #298

Merged
merged 5 commits into from
Jun 13, 2023
Merged

Update errorResponseBuilderContext type with ban property #298

merged 5 commits into from
Jun 13, 2023

Conversation

leonitousconforti
Copy link
Contributor

@leonitousconforti leonitousconforti commented Jun 10, 2023

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 comment

Checklist

  • run npm run test and npm run benchmark not needed?
  • tests and/or benchmarks are included
  • documentation is changed or added documentation is already correct
  • commit message and code follows the Developer's Certification of Origin
    and the Code of conduct

@leonitousconforti
Copy link
Contributor Author

Not entirely sure why all those tests are failing, but I don't understand how it could be from my change to the types

@Eomm
Copy link
Member

Eomm commented Jun 10, 2023

It is due to this PR: fastify/light-my-request#248

We need to update the comparisons

@Uzlopak
Copy link
Contributor

Uzlopak commented Jun 10, 2023

@Eomm
created a PR to fix the CI

#299

@Eomm
Copy link
Member

Eomm commented Jun 10, 2023

can't update the branch tho

@Eomm
Copy link
Member

Eomm commented Jun 10, 2023

@leonitousconforti could you add a test here https://github.com/fastify/fastify-rate-limit/blob/master/types/index.test-d.ts too?

@leonitousconforti
Copy link
Contributor Author

Let me know what you think about the changes to the tests

Add limit back
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mcollina mcollina merged commit 5293e46 into fastify:master Jun 13, 2023
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

Successfully merging this pull request may close these issues.

4 participants