Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions content/guides/security/rate_limiting.md
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,12 @@ When a user exhausts their rate limit, the middleware throws the `E_TOO_MANY_REQ

See also: [E_TOO_MANY_REQUESTS exception reference](../../reference/exceptions.md#e_too_many_requests)

The middleware will also add the following response headers:
- `X-RateLimit-Limit`: Total number of requests that can be made
- `X-RateLimit-Remaining` Number of requests remaining
- `Retry-After`: Number of seconds after which the client can retry
- `X-RateLimit-Reset`: Timestamp after which the client can retry

### Customizing the error response

You can customize the error message without handling the exception globally using the `limitExceeded` hook:
Expand Down