refactor: propfind with auth no need to list all (#344)

This commit is contained in:
sigoden
2024-01-11 16:10:10 +08:00
committed by GitHub
parent 81d2c49e3f
commit de0614816a
2 changed files with 21 additions and 7 deletions

View File

@@ -374,12 +374,13 @@ impl Server {
method => match method.as_str() {
"PROPFIND" => {
if is_dir {
let access_paths = if access_paths.perm().inherit() {
// see https://github.com/sigoden/dufs/issues/229
AccessPaths::new(AccessPerm::ReadOnly)
} else {
access_paths
};
let access_paths =
if access_paths.perm().inherit() && authorization.is_none() {
// see https://github.com/sigoden/dufs/issues/229
AccessPaths::new(AccessPerm::ReadOnly)
} else {
access_paths
};
self.handle_propfind_dir(path, headers, access_paths, &mut res)
.await?;
} else if is_file {