Xuanwo commented on code in PR #1783:
URL: 
https://github.com/apache/incubator-opendal/pull/1783#discussion_r1150007362


##########
core/src/services/webdav/backend.rs:
##########
@@ -322,18 +324,40 @@ impl Accessor for WebdavBackend {
             return Ok(RpStat::new(Metadata::new(EntryMode::DIR)));
         }
 
-        let resp = self.webdav_head(path).await?;
+        let mut header_map = HeaderMap::new();
+        // not include children
+        header_map.insert("Depth", "0".parse().unwrap());
+        header_map.insert(
+            header::ACCEPT,
+            "text/plain,application/xml".parse().unwrap(),
+        );
+
+        let resp = self.webdav_propfind(path, Some(header_map)).await?;
 
         let status = resp.status();
 
-        match status {
-            StatusCode::OK => parse_into_metadata(path, 
resp.headers()).map(RpStat::new),
-            // HTTP Server like nginx could return FORBIDDEN if auto-index

Review Comment:
   **Suggestion**: It would be preferable to leave the comments in this 
location.



##########
core/src/services/webdav/backend.rs:
##########
@@ -322,18 +324,40 @@ impl Accessor for WebdavBackend {
             return Ok(RpStat::new(Metadata::new(EntryMode::DIR)));
         }
 
-        let resp = self.webdav_head(path).await?;
+        let mut header_map = HeaderMap::new();
+        // not include children
+        header_map.insert("Depth", "0".parse().unwrap());
+        header_map.insert(
+            header::ACCEPT,
+            "text/plain,application/xml".parse().unwrap(),

Review Comment:
   **request-change**: accept `text/plain` is wrong as we can't parse plain 
response.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to