fix: Mismatch between route registered vs checked for custom rate limiters
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user