Skip to content

Commit bd3f491

Browse files
committed
Check blocked users every time but log once
1 parent 06ce8c3 commit bd3f491

File tree

3 files changed

+1
-3
lines changed

3 files changed

+1
-3
lines changed

library/middleware/shouldBlockRequest.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ export function shouldBlockRequest(): Result {
2323

2424
if (context.executedMiddleware) {
2525
logWarningAlreadyExecutedMiddleware();
26-
return { block: false };
2726
}
2827

2928
updateContext(context, "executedMiddleware", true);

library/ratelimiting/shouldRateLimitRequest.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,6 @@ t.test(
502502
block: false,
503503
});
504504

505-
t.same(logs, ["Zen.addMiddleware(...) should be called only once."]);
505+
t.same(logs, []);
506506
}
507507
);

library/ratelimiting/shouldRateLimitRequest.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ export function shouldRateLimitRequest(
2424
// Do not consume rate limit for the same request a second time
2525
// (Might happen if the user adds the middleware multiple times)
2626
if (context.consumedRateLimit) {
27-
logWarningIfMiddlewareExecutedTwice();
2827
return { block: false };
2928
}
3029

0 commit comments

Comments
 (0)