Skip to content

Commit

Permalink
Fix webdav test
Browse files Browse the repository at this point in the history
Signed-off-by: Xuanwo <github@xuanwo.io>
  • Loading branch information
Xuanwo committed Mar 1, 2023
1 parent efdc269 commit 9ca8ea9
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/services/webdav/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,10 +306,9 @@ impl Accessor for WebdavBackend {
}

async fn write(&self, path: &str, args: OpWrite) -> Result<(RpWrite, Self::Writer)> {
Ok((
RpWrite::default(),
WebdavWriter::new(self.clone(), args, path.to_string()),
))
let p = build_abs_path(&self.root, path);

Ok((RpWrite::default(), WebdavWriter::new(self.clone(), args, p)))
}

async fn stat(&self, path: &str, _: OpStat) -> Result<RpStat> {
Expand Down Expand Up @@ -410,15 +409,13 @@ impl WebdavBackend {

pub async fn webdav_put(
&self,
path: &str,
abs_path: &str,
size: Option<usize>,
content_type: Option<&str>,
content_disposition: Option<&str>,
body: AsyncBody,
) -> Result<Response<IncomingAsyncBody>> {
let p = build_abs_path(&self.root, path);

let url = format!("{}/{}", self.endpoint, percent_encode_path(&p));
let url = format!("{}/{}", self.endpoint, percent_encode_path(abs_path));

let mut req = Request::put(&url);

Expand Down

1 comment on commit 9ca8ea9

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for opendal ready!

✅ Preview
https://opendal-a96xfu9lj-databend.vercel.app
https://opendal-git-object-writer.vercel.app

Built with commit 9ca8ea9.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.