Skip to content

Commit

Permalink
chore: improve coverage (#372)
Browse files Browse the repository at this point in the history
  • Loading branch information
jean-michelet authored Jul 13, 2024
1 parent 2703ec6 commit 8221b20
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 0 additions & 1 deletion .taprc
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
jobs: 1
disable-coverage: true
files:
- test/**/*.test.js
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,12 @@ The response will have the following headers if `enableDraftSpec` is `true`:
|`ratelimit-reset` | how many seconds must pass before the rate limit resets
|`retry-after` | contains the same value in time as `ratelimit-reset`

### Contribute
To run tests locally, you need a Redis instance that you can launch with this command:
```
npm run redis
```

<a name="license"></a>
## License
**[MIT](https://github.com/fastify/fastify-rate-limit/blob/master/LICENSE)**<br>
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ function mergeParams (...params) {
}

function addRouteRateHook (pluginComponent, params, routeOptions) {
const hook = params.hook || defaultHook
const hook = params.hook
const hookHandler = rateLimitRequestHandler(pluginComponent, params)
if (Array.isArray(routeOptions[hook])) {
routeOptions[hook].push(hookHandler)
Expand Down

0 comments on commit 8221b20

Please sign in to comment.