From c740a5b412d6f348873504da9e3bece105df45eb Mon Sep 17 00:00:00 2001 From: SebastianKrupinski Date: Thu, 4 Jul 2024 11:16:03 -0400 Subject: [PATCH] fix(carddav): limit vcard size Signed-off-by: SebastianKrupinski --- .../dav/lib/CardDAV/Validation/CardDavValidatePlugin.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/apps/dav/lib/CardDAV/Validation/CardDavValidatePlugin.php b/apps/dav/lib/CardDAV/Validation/CardDavValidatePlugin.php index 0c5adc70fa950..7721c89bee7e4 100644 --- a/apps/dav/lib/CardDAV/Validation/CardDavValidatePlugin.php +++ b/apps/dav/lib/CardDAV/Validation/CardDavValidatePlugin.php @@ -10,7 +10,6 @@ use OCA\DAV\AppInfo\Application; use OCP\IAppConfig; -use OCP\IUserSession; use Sabre\DAV\Server; use Sabre\DAV\Exception\Forbidden; use Sabre\DAV\ServerPlugin; @@ -20,8 +19,7 @@ class CardDavValidatePlugin extends ServerPlugin { public function __construct( - private IAppConfig $config, - private IUserSession $userSession + private IAppConfig $config ) {} public function initialize(Server $server): void { @@ -29,11 +27,6 @@ public function initialize(Server $server): void { } public function beforePut(RequestInterface $request, ResponseInterface $response): bool { - // evaluate if user is logged in - if ($this->userSession->getUser() === null) { - // We only care about authenticated users here - return false; - } // evaluate if card size exceeds defined limit $cardSizeLimit = $this->config->getValueInt(Application::APP_ID, 'card_size_limit', 5242880); if ((int) $request->getRawServerValue('CONTENT_LENGTH') > $cardSizeLimit) {