From b91957e3df058b5d22b9d2bb7c0e464749e4e22d Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 30 Mar 2023 15:02:51 +0200 Subject: fix(dav): Abort requests with 429 instead of waiting Signed-off-by: Joas Schilling --- lib/private/User/Session.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/private/User') diff --git a/lib/private/User/Session.php b/lib/private/User/Session.php index 078539e5489..6273945ec43 100644 --- a/lib/private/User/Session.php +++ b/lib/private/User/Session.php @@ -428,7 +428,7 @@ class Session implements IUserSession, Emitter { IRequest $request, OC\Security\Bruteforce\Throttler $throttler) { $remoteAddress = $request->getRemoteAddress(); - $currentDelay = $throttler->sleepDelay($remoteAddress, 'login'); + $currentDelay = $throttler->sleepDelayOrThrowOnMax($remoteAddress, 'login'); if ($this->manager instanceof PublicEmitter) { $this->manager->emit('\OC\User', 'preLogin', [$user, $password]); @@ -479,7 +479,7 @@ class Session implements IUserSession, Emitter { $this->dispatcher->dispatchTyped(new OC\Authentication\Events\LoginFailed($user, $password)); if ($currentDelay === 0) { - $throttler->sleepDelay($remoteAddress, 'login'); + $throttler->sleepDelayOrThrowOnMax($remoteAddress, 'login'); } } -- cgit v1.2.3