fastify / fastify-rate-limit

A low overhead rate limiter for your routes
MIT License
504 stars 71 forks source link

Wrong type for rateLimit: false #309

Closed Cluster2a closed 1 year ago

Cluster2a commented 1 year ago

Prerequisites

Fastify version

4.19.2

Plugin version

8.0.3

Node.js version

20.3.1

Operating system

Linux

Operating system version (i.e. 20.04, 11.3, 10)

Ubuntu 23.04

Description

Hey, there seems to be an issue with the type:

server.get(
    '/status',
    {
        config: {
            rateLimit: false
        }
    },
    (req, reply) => {
        reply.send();
    }
);

This results in the following error:

image

Steps to Reproduce

Expected Behavior

Should work as documented in the docs:

// this route doesn't have any rate limit
fastify.get('/public', {
  config: {
    rateLimit: false
  }
}, (request, reply) => {
  reply.send({ hello: 'from ... public' })
})
Cluster2a commented 1 year ago

@Uzlopak, is there going to be a new release with the fix?

Uzlopak commented 1 year ago

@eomm @mcollina