From 3a40fe2931e41fb7a12d83958072020bb971849c Mon Sep 17 00:00:00 2001 From: Oleksander Piskun Date: Mon, 11 May 2026 06:10:17 +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 28aced7d1..4bfc51640 100644 --- a/lib/Service/AppAPIService.php +++ b/lib/Service/AppAPIService.php @@ -300,17 +300,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;