From 701294520aad315aeae06b03160830a375e98599 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Tue, 11 May 2021 15:25:31 +0200 Subject: Add bruteforce protection to the shareinfo endpoint Signed-off-by: Roeland Jago Douma --- apps/files_sharing/tests/Controller/ShareInfoControllerTest.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'apps/files_sharing/tests/Controller') diff --git a/apps/files_sharing/tests/Controller/ShareInfoControllerTest.php b/apps/files_sharing/tests/Controller/ShareInfoControllerTest.php index 9ea93b9900a..5de04d8444b 100644 --- a/apps/files_sharing/tests/Controller/ShareInfoControllerTest.php +++ b/apps/files_sharing/tests/Controller/ShareInfoControllerTest.php @@ -66,6 +66,7 @@ class ShareInfoControllerTest extends TestCase { ->willThrowException(new ShareNotFound()); $expected = new JSONResponse([], Http::STATUS_NOT_FOUND); + $expected->throttle(['token' => 'token']); $this->assertEquals($expected, $this->controller->info('token')); } @@ -82,6 +83,7 @@ class ShareInfoControllerTest extends TestCase { ->willReturn(false); $expected = new JSONResponse([], Http::STATUS_FORBIDDEN); + $expected->throttle(['token' => 'token']); $this->assertEquals($expected, $this->controller->info('token', 'pass')); } @@ -100,6 +102,7 @@ class ShareInfoControllerTest extends TestCase { ->willReturn(true); $expected = new JSONResponse([], Http::STATUS_FORBIDDEN); + $expected->throttle(['token' => 'token']); $this->assertEquals($expected, $this->controller->info('token', 'pass')); } -- cgit v1.2.3