summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2016-12-01 19:13:28 +0100
committerLukas Reschke <lukas@statuscode.ch>2016-12-01 19:16:36 +0100
commit7e272adf25f22b5f807d99aefd4f1efad08e0c51 (patch)
tree1b8a6f423408be190313ce0056bcf23df6937be6 /apps
parent8468d7af8b38c81e4752069482dd44d241175edc (diff)
downloadnextcloud-server-7e272adf25f22b5f807d99aefd4f1efad08e0c51.tar.gz
nextcloud-server-7e272adf25f22b5f807d99aefd4f1efad08e0c51.zip
[stable9] Catch status code 400
In case the server returns a statuscode 400 we should also gracefully return to the home directory. Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Diffstat (limited to 'apps')
-rw-r--r--apps/files/js/filelist.js2
-rw-r--r--apps/files/tests/js/filelistSpec.js5
2 files changed, 6 insertions, 1 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index bcf6f991c50..8722ad7d27c 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -1489,7 +1489,7 @@
return false;
}
- if (status === 404 || status === 405) {
+ if (status === 400 || status === 404 || status === 405) {
// go back home
this.changeDirectory('/');
return false;
diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js
index e23a42ec4e9..47cfdbafcf9 100644
--- a/apps/files/tests/js/filelistSpec.js
+++ b/apps/files/tests/js/filelistSpec.js
@@ -1357,6 +1357,11 @@ describe('OCA.Files.FileList tests', function() {
deferredList.reject(404);
expect(fileList.getCurrentDirectory()).toEqual('/');
});
+ it('switches to root dir when current directory returns 400', function() {
+ fileList.changeDirectory('/unexist');
+ deferredList.reject(400);
+ expect(fileList.getCurrentDirectory()).toEqual('/');
+ });
it('switches to root dir when current directory returns 405', function() {
fileList.changeDirectory('/unexist');
deferredList.reject(405);