Skip to content

Commit

Permalink
fix: Convert rate limit headers to string format for consistency
Browse files Browse the repository at this point in the history
Updated the setRateLimitHeaders function to ensure that the 'X-RateLimit-Limit' and 'X-RateLimit-Remaining' headers are set as string values, improving compatibility and preventing potential issues with header interpretation.
  • Loading branch information
Adil committed Dec 19, 2024
1 parent 6555109 commit 693a9f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/set-rate-limit-headers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ export function setRateLimitHeaders(
limit: number,
remaining: number,
) {
res.setHeader('X-RateLimit-Limit', limit)
res.setHeader('X-RateLimit-Remaining', remaining)
res.setHeader('X-RateLimit-Limit', String(limit))
res.setHeader('X-RateLimit-Remaining', String(remaining))
}

0 comments on commit 693a9f1

Please sign in to comment.