Skip to content

Commit 9acab32

Browse files
authored
Merge pull request #861 from nextcloud/backport/860/stable33
[stable33] refactor: simplify enabled-state check in validateExAppRequestToNC
2 parents fbb9a98 + 6f04ea8 commit 9acab32

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

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

0 commit comments

Comments
 (0)