Skip to content

Incorrect Retry-After header value #301

@awlayton

Description

@awlayton

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Fastify version

4.17.0

Plugin version

8.0.0

Node.js version

20.2.0

Operating system

Linux

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

22.04.2

Description

It seems the value of the Retry-After header is expressed in milliseconds instead of seconds (or an http-date) as specified by RFC 9110.

Steps to Reproduce

@fastify/rate-limit options:

const options = {
  max: 5,
  timeWindow: '1 minute',
};

Headers on 429 response:

x-ratelimit-limit: 5
x-ratelimit-remaining: 0
x-ratelimit-reset: 58
retry-after: 60000

Expected Behavior

The value of Retry-After should be 60 (i.e., 1 minute in seconds), not 60000.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions