summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorChristoph Wurst <ChristophWurst@users.noreply.github.com>2016-12-01 21:25:54 +0100
committerGitHub <noreply@github.com>2016-12-01 21:25:54 +0100
commitea45b220535310f063a4785f2281c96b7c7c2581 (patch)
treedc988237a306cc2e38be70d4cadb670e8096c8f8 /apps
parent61d61e794c9f3386757572431dced77474bb7c3f (diff)
parent9704b4df5287b41dc80f83b032b406f664ae021c (diff)
downloadnextcloud-server-ea45b220535310f063a4785f2281c96b7c7c2581.tar.gz
nextcloud-server-ea45b220535310f063a4785f2281c96b7c7c2581.zip
Merge pull request #2444 from nextcloud/detect-also-a-400-status
Catch status code 400
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 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);