From e9e09b82b908690991cd9c60e4baedd8833c83f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Tue, 9 Jul 2019 10:55:46 +0200 Subject: Reconnect after session has timed out MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/Service/ApiService.php | 4 +++- lib/Service/DocumentService.php | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/Service/ApiService.php b/lib/Service/ApiService.php index 83a7a8124..c6a35c610 100644 --- a/lib/Service/ApiService.php +++ b/lib/Service/ApiService.php @@ -145,7 +145,7 @@ class ApiService { } return new DataResponse($steps); } - return new DataResponse([], 500); + return new DataResponse([], 403); } public function sync($documentId, $sessionId, $sessionToken, $version = 0, $autosaveContent = null, bool $force = false, bool $manualSave = false, $token = null): DataResponse { @@ -176,6 +176,8 @@ class ApiService { } catch (LockedException $e) { // Ignore locked exception since it might happen due to an autosave action happening at the same time } + } catch (NotFoundException $e) { + return new DataResponse([], 404); } catch (Exception $e) { $this->logger->logException($e); return new DataResponse([ diff --git a/lib/Service/DocumentService.php b/lib/Service/DocumentService.php index f2784da5c..31dcb6910 100644 --- a/lib/Service/DocumentService.php +++ b/lib/Service/DocumentService.php @@ -237,6 +237,10 @@ class DocumentService { $file = $this->getFileByShareToken($token, $filePath); } + if ($file === null) { + throw new NotFoundException(); + } + if ($this->isReadOnly($file, $token)) { return $document; } -- cgit v1.2.3