Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(services/webdav): Fix lister failing when root contains spaces #5298

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions core/src/services/webdav/lister.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,14 @@ impl oio::PageList for WebdavLister {
path += "/"
}

let decoded_path = percent_decode_path(&path);

// Ignore the root path itself.
if self.core.root == path {
if self.core.root == decoded_path {
continue;
}

let normalized_path = build_rel_path(&self.core.root, &path);
let decoded_path = percent_decode_path(&normalized_path);
let normalized_path = build_rel_path(&self.core.root, &decoded_path);

// HACKS! HACKS! HACKS!
//
Expand All @@ -97,7 +98,8 @@ impl oio::PageList for WebdavLister {
continue;
}

ctx.entries.push_back(oio::Entry::new(&decoded_path, meta))
ctx.entries
.push_back(oio::Entry::new(&normalized_path, meta))
}
ctx.done = true;

Expand Down
Loading