fix(files): sharing root folder is not allowed

This commit is contained in:
hexxa 2022-03-20 20:33:19 +08:00 committed by Hexxa
parent 0db1903e42
commit 9ff28ecce4
3 changed files with 30 additions and 1 deletions

View file

@ -441,6 +441,21 @@ func TestFileHandlers(t *testing.T) {
} else if res.StatusCode != 200 {
t.Fatal(res.StatusCode)
}
res, _, errs = cl.AddSharing(filePath)
if res.StatusCode != 400 {
t.Fatal(res.StatusCode)
}
res, _, errs = cl.AddSharing(filepath.Join(filePath, "not_exist"))
if res.StatusCode != 500 {
t.Fatal(res.StatusCode)
}
}
res, _, errs := cl.AddSharing("/")
if res.StatusCode != 403 {
t.Fatal(res.StatusCode)
}
// check listSharings

Binary file not shown.