Skip to content

Commit

Permalink
Merge pull request #539 from krakan/dont-warn-for-non-authenticating-…
Browse files Browse the repository at this point in the history
…calls

Don't warn for non authenticating calls
  • Loading branch information
ato committed Jan 23, 2023
2 parents b9cb43e + de5c419 commit a34d9f3
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ public RateLimitGuard(Context context, String realm, String serverKey) throws Il
@Override
protected boolean authenticate(Request request, Response response) {
boolean succeeded = super.authenticate(request, response);
if (!succeeded) {
String authHeader = request.getHeaders().getFirstValue("Authorization", true);
if (authHeader != null && !succeeded) {
logger.warning("authentication failure "+request);
// wait until at least LAG has passed from last failure
// holding object lock the whole time, so no other checks
Expand All @@ -59,7 +60,7 @@ protected boolean authenticate(Request request, Response response) {
// ignore
}
}
lastFailureTime = now + sleepMs;
lastFailureTime = now;
}
return succeeded;
}
Expand Down

0 comments on commit a34d9f3

Please sign in to comment.