Match on 405

This commit is contained in:
Lukas Reschke 2016-07-01 15:19:08 +02:00
parent 8aa0832bd4
commit dea8e29289
No known key found for this signature in database
GPG Key ID: 9AB0ADB949B6898C
2 changed files with 6 additions and 1 deletions

View File

@ -1469,7 +1469,7 @@
return false;
}
if (status === 404) {
if (status === 404 || status === 405) {
// go back home
this.changeDirectory('/');
return false;

View File

@ -1336,6 +1336,11 @@ describe('OCA.Files.FileList tests', function() {
deferredList.reject(404);
expect(fileList.getCurrentDirectory()).toEqual('/');
});
it('switches to root dir when current directory returns 405', function() {
fileList.changeDirectory('/unexist');
deferredList.reject(405);
expect(fileList.getCurrentDirectory()).toEqual('/');
});
it('switches to root dir when current directory is forbidden', function() {
fileList.changeDirectory('/unexist');
deferredList.reject(403);