You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by xu...@apache.org on 2023/07/18 06:50:52 UTC
[incubator-opendal] branch try-fix-owncloud updated: try
This is an automated email from the ASF dual-hosted git repository.
xuanwo pushed a commit to branch try-fix-owncloud
in repository https://gitbox.apache.org/repos/asf/incubator-opendal.git
The following commit(s) were added to refs/heads/try-fix-owncloud by this push:
new 95775a7c1 try
95775a7c1 is described below
commit 95775a7c1bf648a324e44be74ef1d71cff475f59
Author: Xuanwo <gi...@xuanwo.io>
AuthorDate: Tue Jul 18 14:50:43 2023 +0800
try
Signed-off-by: Xuanwo <gi...@xuanwo.io>
---
core/src/services/webdav/backend.rs | 2 +-
core/src/services/webdav/error.rs | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/core/src/services/webdav/backend.rs b/core/src/services/webdav/backend.rs
index 65b552583..64fa3c73b 100644
--- a/core/src/services/webdav/backend.rs
+++ b/core/src/services/webdav/backend.rs
@@ -573,7 +573,7 @@ impl WebdavBackend {
let url = format!("{}/{}", self.endpoint, percent_encode_path(&p));
- let mut req = Request::delete(&url).header("Depth", 0);
+ let mut req = Request::delete(&url);
if let Some(auth) = &self.authorization {
req = req.header(header::AUTHORIZATION, auth.clone())
diff --git a/core/src/services/webdav/error.rs b/core/src/services/webdav/error.rs
index c3110b2bc..472e7e30a 100644
--- a/core/src/services/webdav/error.rs
+++ b/core/src/services/webdav/error.rs
@@ -30,7 +30,8 @@ pub async fn parse_error(resp: Response<IncomingAsyncBody>) -> Result<Error> {
let (kind, retryable) = match parts.status {
StatusCode::NOT_FOUND => (ErrorKind::NotFound, false),
- StatusCode::FORBIDDEN => (ErrorKind::PermissionDenied, false),
+ // Some services (like owncloud) return 403 while file locked.
+ StatusCode::FORBIDDEN => (ErrorKind::PermissionDenied, true),
// Allowing retry for resource locked.
StatusCode::LOCKED => (ErrorKind::Unexpected, true),
StatusCode::INTERNAL_SERVER_ERROR