Skip to content

Commit 3a40fe2

Browse files
committed
refactor: simplify enabled-state check in validateExAppRequestToNC
Signed-off-by: Oleksander Piskun <oleksandr2088@icloud.com>
1 parent 0ea55b6 commit 3a40fe2

1 file changed

Lines changed: 9 additions & 11 deletions

File tree

lib/Service/AppAPIService.php

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -300,17 +300,15 @@ public function validateExAppRequestToNC(IRequest $request, bool $isDav = false)
300300
$authValid = $authorizationSecret === $exApp->getSecret();
301301

302302
if ($authValid) {
303-
if (!$isDav) {
304-
try {
305-
$path = $request->getPathInfo();
306-
} catch (\Exception $e) {
307-
$this->logger->error(sprintf('Error getting path info. Error: %s', $e->getMessage()), ['exception' => $e]);
308-
return false;
309-
}
310-
if (($this->sanitizeOcsRoute($path) !== '/apps/app_api/ex-app/state') && !$exApp->getEnabled()) {
311-
$this->logger->error(sprintf('ExApp with appId %s is disabled (%s)', $request->getHeader('EX-APP-ID'), $request->getRequestUri()));
312-
return false;
313-
}
303+
try {
304+
$path = $request->getPathInfo();
305+
} catch (\Exception $e) {
306+
$this->logger->error(sprintf('Error getting path info. Error: %s', $e->getMessage()), ['exception' => $e]);
307+
return false;
308+
}
309+
if (($this->sanitizeOcsRoute($path) !== '/apps/app_api/ex-app/state') && !$exApp->getEnabled()) {
310+
$this->logger->error(sprintf('ExApp with appId %s is disabled (%s)', $request->getHeader('EX-APP-ID'), $request->getRequestUri()));
311+
return false;
314312
}
315313
if (!$this->handleExAppVersionChange($request, $exApp)) {
316314
return false;

0 commit comments

Comments
 (0)