Skip to content

Commit ecaaec9

Browse files
committed
refactor: simplify enabled-state check in validateExAppRequestToNC
Signed-off-by: Oleksander Piskun <oleksandr2088@icloud.com>
1 parent 801b0f4 commit ecaaec9

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
@@ -305,17 +305,15 @@ public function validateExAppRequestToNC(IRequest $request, bool $isDav = false)
305305
$authValid = $authorizationSecret === $exApp->getSecret();
306306

307307
if ($authValid) {
308-
if (!$isDav) {
309-
try {
310-
$path = $request->getPathInfo();
311-
} catch (\Exception $e) {
312-
$this->logger->error(sprintf('Error getting path info. Error: %s', $e->getMessage()), ['exception' => $e]);
313-
return false;
314-
}
315-
if (!$exApp->getEnabled() && !$this->isExemptFromEnabledCheck($path, $exApp)) {
316-
$this->logger->error(sprintf('ExApp with appId %s is disabled (%s)', $request->getHeader('EX-APP-ID'), $request->getRequestUri()));
317-
return false;
318-
}
308+
try {
309+
$path = $request->getPathInfo();
310+
} catch (\Exception $e) {
311+
$this->logger->error(sprintf('Error getting path info. Error: %s', $e->getMessage()), ['exception' => $e]);
312+
return false;
313+
}
314+
if (!$exApp->getEnabled() && !$this->isExemptFromEnabledCheck($path, $exApp)) {
315+
$this->logger->error(sprintf('ExApp with appId %s is disabled (%s)', $request->getHeader('EX-APP-ID'), $request->getRequestUri()));
316+
return false;
319317
}
320318
if (!$this->handleExAppVersionChange($request, $exApp)) {
321319
return false;

0 commit comments

Comments
 (0)