Skip to content
Permalink
Browse files Browse the repository at this point in the history
Match on 405
  • Loading branch information
LukasReschke committed Jul 1, 2016
1 parent 8aa0832 commit dea8e29
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion apps/files/js/filelist.js
Expand Up @@ -1469,7 +1469,7 @@
return false;
}

if (status === 404) {
if (status === 404 || status === 405) {
// go back home
this.changeDirectory('/');
return false;
Expand Down
5 changes: 5 additions & 0 deletions apps/files/tests/js/filelistSpec.js
Expand Up @@ -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);
Expand Down

0 comments on commit dea8e29

Please sign in to comment.