From bae450bf6256d603f97efa2145f4f1efb94183ae Mon Sep 17 00:00:00 2001 From: Oleksander Piskun Date: Mon, 11 May 2026 06:06:36 +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 c42c50788..0b0f574f7 100644 --- a/lib/Service/AppAPIService.php +++ b/lib/Service/AppAPIService.php @@ -301,17 +301,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 (($this->sanitizeOcsRoute($path) !== '/apps/app_api/ex-app/state') && !$exApp->getEnabled()) { - $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 (($this->sanitizeOcsRoute($path) !== '/apps/app_api/ex-app/state') && !$exApp->getEnabled()) { + $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;