aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files
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:13:28 +0100
commit9704b4df5287b41dc80f83b032b406f664ae021c (patch)
tree095fd91a19a9e7244f677bf73445e18ffaa8f189 /apps/files
parent5cea7f35e124ea7a6b8352a1d05c00069e8814ae (diff)
downloadnextcloud-server-9704b4df5287b41dc80f83b032b406f664ae021c.tar.gz
nextcloud-server-9704b4df5287b41dc80f83b032b406f664ae021c.zip
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/files')
-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 fb0439114ed..a8daeadfd26 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -1638,7 +1638,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 d8fc3907d78..c5a75be7c62 100644
--- a/apps/files/tests/js/filelistSpec.js
+++ b/apps/files/tests/js/filelistSpec.js
@@ -1454,6 +1454,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);