Skip to content

Commit 28fccd5

Browse files
committed
Always prefix any rate limiter in Redis with “ratelimit:”
1 parent 0d46cc9 commit 28fccd5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

apps/webapp/app/services/apiRateLimit.server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ export function authorizationRateLimitMiddleware({
145145
}
146146

147147
export const apiRateLimiter = authorizationRateLimitMiddleware({
148-
keyPrefix: "ratelimit:api",
148+
keyPrefix: "api",
149149
limiter: Ratelimit.slidingWindow(env.API_RATE_LIMIT_MAX, env.API_RATE_LIMIT_WINDOW as Duration),
150150
pathMatchers: [/^\/api/],
151151
// Allow /api/v1/tasks/:id/callback/:secret

apps/webapp/app/services/rateLimiter.server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export class RateLimiter {
3434
limiter,
3535
ephemeralCache: new Map(),
3636
analytics: false,
37-
prefix: keyPrefix,
37+
prefix: `ratelimit:${keyPrefix}`,
3838
});
3939
}
4040

0 commit comments

Comments
 (0)