Merge pull request #2446 from nextcloud/stable9-detect-also-a-400-status
[stable9] Catch status code 400
This commit is contained in:
commit
5fc4d45409
|
@ -1489,7 +1489,7 @@
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status === 404 || status === 405) {
|
if (status === 400 || status === 404 || status === 405) {
|
||||||
// go back home
|
// go back home
|
||||||
this.changeDirectory('/');
|
this.changeDirectory('/');
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -1357,6 +1357,11 @@ describe('OCA.Files.FileList tests', function() {
|
||||||
deferredList.reject(404);
|
deferredList.reject(404);
|
||||||
expect(fileList.getCurrentDirectory()).toEqual('/');
|
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() {
|
it('switches to root dir when current directory returns 405', function() {
|
||||||
fileList.changeDirectory('/unexist');
|
fileList.changeDirectory('/unexist');
|
||||||
deferredList.reject(405);
|
deferredList.reject(405);
|
||||||
|
|
Loading…
Reference in New Issue