Skip to content

Commit

Permalink
Add separate status code if the lock is not found on unlock
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <jus@bitgrid.net>
  • Loading branch information
juliusknorr committed Apr 21, 2022
1 parent d5eb19c commit 29c2c69
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/DAV/LockPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use OCA\FilesLock\Model\FileLock;
use OCA\FilesLock\Service\FileService;
use OCA\FilesLock\Service\LockService;
use OCP\AppFramework\Http;
use OCP\Files\InvalidPathException;
use OCP\Files\Lock\ILock;
use OCP\Files\Lock\LockContext;
Expand Down Expand Up @@ -200,9 +201,9 @@ public function httpUnlock(RequestInterface $request, ResponseInterface $respons
)
);
} catch (LockNotFoundException $e) {
$response->setStatus(403);
$response->setStatus(Http::STATUS_PRECONDITION_FAILED);
} catch (UnauthorizedUnlockException $e) {
$response->setStatus(403);
$response->setStatus(Http::STATUS_FORBIDDEN);
} catch (InvalidPathException $e) {
} catch (NotFoundException $e) {
}
Expand Down

0 comments on commit 29c2c69

Please sign in to comment.