From ecaaec96fed44d8352a14cc59e97884f7e653e7b Mon Sep 17 00:00:00 2001 From: Oleksander Piskun Date: Sun, 10 May 2026 05:37:23 +0000 Subject: [PATCH] refactor: simplify enabled-state check in validateExAppRequestToNC Signed-off-by: Oleksander Piskun --- lib/Service/AppAPIService.php | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/lib/Service/AppAPIService.php b/lib/Service/AppAPIService.php index 66e6fde9..1d86f299 100644 --- a/lib/Service/AppAPIService.php +++ b/lib/Service/AppAPIService.php @@ -305,17 +305,15 @@ public function validateExAppRequestToNC(IRequest $request, bool $isDav = false) $authValid = $authorizationSecret === $exApp->getSecret(); if ($authValid) { - if (!$isDav) { - try { - $path = $request->getPathInfo(); - } catch (\Exception $e) { - $this->logger->error(sprintf('Error getting path info. Error: %s', $e->getMessage()), ['exception' => $e]); - return false; - } - if (!$exApp->getEnabled() && !$this->isExemptFromEnabledCheck($path, $exApp)) { - $this->logger->error(sprintf('ExApp with appId %s is disabled (%s)', $request->getHeader('EX-APP-ID'), $request->getRequestUri())); - return false; - } + try { + $path = $request->getPathInfo(); + } catch (\Exception $e) { + $this->logger->error(sprintf('Error getting path info. Error: %s', $e->getMessage()), ['exception' => $e]); + return false; + } + if (!$exApp->getEnabled() && !$this->isExemptFromEnabledCheck($path, $exApp)) { + $this->logger->error(sprintf('ExApp with appId %s is disabled (%s)', $request->getHeader('EX-APP-ID'), $request->getRequestUri())); + return false; } if (!$this->handleExAppVersionChange($request, $exApp)) { return false;