Skip to content

Commit

Permalink
fix: Mismatch between route registered vs checked for custom rate lim…
Browse files Browse the repository at this point in the history
…iters
  • Loading branch information
tommoor committed Jan 23, 2024
1 parent 0d797d4 commit aadd916
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions server/middlewares/rateLimiter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,11 @@ export function rateLimiter(config: RateLimiterConfig) {
return next();
}

if (!RateLimiter.hasRateLimiter(ctx.path)) {
const fullPath = `${ctx.mountPath ?? ""}${ctx.path}`;

if (!RateLimiter.hasRateLimiter(fullPath)) {
RateLimiter.setRateLimiter(
ctx.path,
fullPath,
defaults(
{
...config,
Expand Down

0 comments on commit aadd916

Please sign in to comment.