diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2019-11-13 20:43:20 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2019-11-13 20:43:20 +0100 |
commit | 54eb27dab2e3b5fe7a91b0fc388ae52de311d660 (patch) | |
tree | 26d6b780595f925db4fc8195a048a0242f2c3ff6 /core/Controller | |
parent | 4fcba8a597016c0f640a452b8ebcb7429eca875c (diff) | |
download | nextcloud-server-54eb27dab2e3b5fe7a91b0fc388ae52de311d660.tar.gz nextcloud-server-54eb27dab2e3b5fe7a91b0fc388ae52de311d660.zip |
Update tests
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'core/Controller')
-rw-r--r-- | core/Controller/AvatarController.php | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/core/Controller/AvatarController.php b/core/Controller/AvatarController.php index 45c0daece02..28416264eb3 100644 --- a/core/Controller/AvatarController.php +++ b/core/Controller/AvatarController.php @@ -80,18 +80,6 @@ class AvatarController extends Controller { /** @var IAccountManager */ private $accountManager; - /** - * @param string $appName - * @param IRequest $request - * @param IAvatarManager $avatarManager - * @param ICache $cache - * @param IL10N $l10n - * @param IUserManager $userManager - * @param IRootFolder $rootFolder - * @param ILogger $logger - * @param string $userId - * @param TimeFactory $timeFactory - */ public function __construct($appName, IRequest $request, IAvatarManager $avatarManager, @@ -137,7 +125,7 @@ class AvatarController extends Controller { $user = $this->userManager->get($userId); if ($user === null) { - return $this->return404(); + return new JSONResponse([], Http::STATUS_NOT_FOUND); } $account = $this->accountManager->getAccount($user); @@ -145,7 +133,7 @@ class AvatarController extends Controller { if ($scope !== IAccountManager::VISIBILITY_PUBLIC && $this->userId === null) { // Public avatar access is not allowed - return $this->return404(); + return new JSONResponse([], Http::STATUS_NOT_FOUND); } try { @@ -157,7 +145,7 @@ class AvatarController extends Controller { ['Content-Type' => $avatarFile->getMimeType()] ); } catch (\Exception $e) { - return $this->return404(); + return new JSONResponse([], Http::STATUS_NOT_FOUND); } // Cache for 30 minutes @@ -165,12 +153,6 @@ class AvatarController extends Controller { return $resp; } - private function return404(): Http\Response { - $resp = new Http\Response(); - $resp->setStatus(Http::STATUS_NOT_FOUND); - return $resp; - } - /** * @NoAdminRequired * |