diff --git a/src/throttler.guard.ts b/src/throttler.guard.ts index ec4be96e..98d768dc 100644 --- a/src/throttler.guard.ts +++ b/src/throttler.guard.ts @@ -58,6 +58,9 @@ export class ThrottlerGuard implements CanActivate { const handler = context.getHandler(); const classRef = context.getClass(); + if (await this.shouldSkip(context)) { + return true; + } const continues: boolean[] = []; for (const namedThrottler of this.throttlers) { // Return early if the current route should be skipped. @@ -89,6 +92,10 @@ export class ThrottlerGuard implements CanActivate { return continues.every((cont) => cont); } + protected async shouldSkip(_context: ExecutionContext): Promise { + return false; + } + /** * Throttles incoming HTTP requests. * All the outgoing requests will contain RFC-compatible RateLimit headers.