Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/text.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2019-07-09 11:55:46 +0300
committerJulius Härtl <jus@bitgrid.net>2019-07-10 17:11:40 +0300
commite9e09b82b908690991cd9c60e4baedd8833c83f5 (patch)
tree281ef8ea4a2a03624c7f9a1f5638c54b36e25498 /lib
parenteb155ec1e94f33574d990fb33459b91bce311e18 (diff)
Reconnect after session has timed out
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib')
-rw-r--r--lib/Service/ApiService.php4
-rw-r--r--lib/Service/DocumentService.php4
2 files changed, 7 insertions, 1 deletions
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;
}