From 693a9f132e7a8dfa2a8ff89368c5f99080561a1e Mon Sep 17 00:00:00 2001 From: Adil Date: Thu, 19 Dec 2024 16:55:02 +0100 Subject: [PATCH] fix: Convert rate limit headers to string format for consistency 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. --- src/utils/set-rate-limit-headers.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/set-rate-limit-headers.ts b/src/utils/set-rate-limit-headers.ts index 66601eb..5b2e713 100644 --- a/src/utils/set-rate-limit-headers.ts +++ b/src/utils/set-rate-limit-headers.ts @@ -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)) }