From 9baa53081be9deba90c1212cf023daa9ed87a295 Mon Sep 17 00:00:00 2001 From: imWildCat Date: Fri, 17 Feb 2023 20:44:53 -0800 Subject: [PATCH] non-existing dir to Ok() --- src/services/webdav/backend.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/services/webdav/backend.rs b/src/services/webdav/backend.rs index 03d00e1aeff0..5d83f161efe2 100644 --- a/src/services/webdav/backend.rs +++ b/src/services/webdav/backend.rs @@ -315,6 +315,17 @@ impl Accessor for WebdavBackend { DirStream::new(&self.root, path, result, args.limit()), )) } + StatusCode::NOT_FOUND if path.ends_with('/') => Ok(( + RpList::default(), + DirStream::new( + &self.root, + path, + Multistatus { + response: Vec::new(), + }, + args.limit(), + ), + )), _ => Err(parse_error(resp).await?), } } @@ -482,6 +493,10 @@ impl WebdavBackend { let p = build_abs_path(&self.root, path); let url = format!("{}/{}", self.endpoint, percent_encode_path(&p)); + println!( + "webdav url: {} first: {}, second: {}", + url, self.endpoint, p + ); let mut req = Request::builder() .method("PROPFIND") .uri(&url)