summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2017-04-19 09:27:23 +0200
committerGitHub <noreply@github.com>2017-04-19 09:27:23 +0200
commitad24b86013d60e7efe2487ae06478f624b01824f (patch)
tree1b8d7443469ed5da339ba880b69a445784cd73bd /apps/files_sharing
parentf1ddb939a0f263582acbadf4e2dd6277638f2ce3 (diff)
parent727688ebd9c7cdeea4495e93f11b7f7bef9af109 (diff)
downloadnextcloud-server-ad24b86013d60e7efe2487ae06478f624b01824f.tar.gz
nextcloud-server-ad24b86013d60e7efe2487ae06478f624b01824f.zip
Merge pull request #4350 from nextcloud/adjust-old-bruteforce-protection-annotations
Adjust existing bruteforce protection code
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/lib/Controller/ShareController.php4
-rw-r--r--apps/files_sharing/tests/Controller/ShareControllerTest.php1
2 files changed, 4 insertions, 1 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareController.php b/apps/files_sharing/lib/Controller/ShareController.php
index 732a1d32ee7..759d5ee4163 100644
--- a/apps/files_sharing/lib/Controller/ShareController.php
+++ b/apps/files_sharing/lib/Controller/ShareController.php
@@ -182,7 +182,9 @@ class ShareController extends Controller {
return new RedirectResponse($this->urlGenerator->linkToRoute('files_sharing.sharecontroller.showShare', array('token' => $token)));
}
- return new TemplateResponse($this->appName, 'authenticate', array('wrongpw' => true), 'guest');
+ $response = new TemplateResponse($this->appName, 'authenticate', array('wrongpw' => true), 'guest');
+ $response->throttle();
+ return $response;
}
/**
diff --git a/apps/files_sharing/tests/Controller/ShareControllerTest.php b/apps/files_sharing/tests/Controller/ShareControllerTest.php
index c9a1d5ecb24..62adca53f4c 100644
--- a/apps/files_sharing/tests/Controller/ShareControllerTest.php
+++ b/apps/files_sharing/tests/Controller/ShareControllerTest.php
@@ -280,6 +280,7 @@ class ShareControllerTest extends \Test\TestCase {
$response = $this->shareController->authenticate('token', 'invalidpassword');
$expectedResponse = new TemplateResponse($this->appName, 'authenticate', array('wrongpw' => true), 'guest');
+ $expectedResponse->throttle();
$this->assertEquals($expectedResponse, $response);
}