Merge pull request #2444 from nextcloud/detect-also-a-400-status

Catch status code 400
This commit is contained in:
Christoph Wurst 2016-12-01 21:25:54 +01:00 committed by GitHub
commit ea45b22053
2 changed files with 6 additions and 1 deletions

View file

@ -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;

View file

@ -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);