mirror of
https://github.com/nextcloud/server.git
synced 2025-03-16 17:24:10 +00:00
Catch status code 400
In case the server returns a statuscode 400 we should also gracefully return to the home directory. Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
This commit is contained in:
parent
5cea7f35e1
commit
9704b4df52
2 changed files with 6 additions and 1 deletions
apps/files
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue