aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/User
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2023-03-30 15:02:51 +0200
committerJoas Schilling <coding@schilljs.com>2023-05-03 22:43:36 +0200
commitb91957e3df058b5d22b9d2bb7c0e464749e4e22d (patch)
treea1927cb13763b90d1b9fedac607802fb7fc3d5b3 /lib/private/User
parentdf5283ad05f8ffa1a0fe979429746ca071a54326 (diff)
downloadnextcloud-server-b91957e3df058b5d22b9d2bb7c0e464749e4e22d.tar.gz
nextcloud-server-b91957e3df058b5d22b9d2bb7c0e464749e4e22d.zip
fix(dav): Abort requests with 429 instead of waiting
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private/User')
-rw-r--r--lib/private/User/Session.php4
1 files changed, 2 insertions, 2 deletions
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');
}
}