fix: Mismatch between route registered vs checked for custom rate limiters

This commit is contained in:
Tom Moor
2024-01-22 22:40:17 -05:00
parent 0d797d49e3
commit aadd916336

View File

@@ -73,9 +73,11 @@ export function rateLimiter(config: RateLimiterConfig) {
return next(); return next();
} }
if (!RateLimiter.hasRateLimiter(ctx.path)) { const fullPath = `${ctx.mountPath ?? ""}${ctx.path}`;
if (!RateLimiter.hasRateLimiter(fullPath)) {
RateLimiter.setRateLimiter( RateLimiter.setRateLimiter(
ctx.path, fullPath,
defaults( defaults(
{ {
...config, ...config,