Skip to content

Retrieve number of remaining requests #73

@jonathan-roy

Description

@jonathan-roy

Hi,

I'm using express-brute as a rate limiter for my API, allowing for example a maximum of 3600 requests per IP per hour. I would like to give some information regarding rate limit through headers on every response (even those that are not rate limited), especially the following ones:

  • RateLimit-Count: number of requests already received from the beginning of the time frame.
  • RateLimit-Reset: date when the time frame is reset. I know there is a 'nextValidRequestDate' argument provided in 'failCallback', but I can't see any way to get that information from a successful request.

Is there a way to do it?

PS: I'm using the in-memory store at the moment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions