Skip to content

Commit

Permalink
fix(rate): coalesce options to empty
Browse files Browse the repository at this point in the history
  • Loading branch information
etienne-bechara committed Aug 1, 2024
1 parent 8a90c5e commit 16fae88
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/rate/rate.interceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class RateInterceptor implements NestInterceptor {
*/
public async intercept(context: ExecutionContext, next: CallHandler): Promise<Observable<any>> {
const options: RateLimitOptions = this.reflector.get(AppMetadataKey.RATE_LIMIT_OPTIONS, context.getHandler());
const { limit: optionsLimit, key: optionsKey, window: optionsWindow } = options;
const { limit: optionsLimit, key: optionsKey, window: optionsWindow } = options || { };

const limit = typeof optionsLimit === 'function'
? optionsLimit(this.contextService)
Expand Down

0 comments on commit 16fae88

Please sign in to comment.