You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "bxb100 (via GitHub)" <gi...@apache.org> on 2023/03/28 01:52:36 UTC

[GitHub] [incubator-opendal] bxb100 opened a new pull request, #1783: fix: align WebDAV stat with RFC specification

bxb100 opened a new pull request, #1783:
URL: https://github.com/apache/incubator-opendal/pull/1783

   closes: #1782


-- 
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: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-opendal] Xuanwo commented on pull request #1783: fix: align WebDAV stat with RFC specification

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on PR #1783:
URL: https://github.com/apache/incubator-opendal/pull/1783#issuecomment-1486240231

   > Thanks review.
   > 
   > I had been using jianguoyun for self-testing, but it is not suitable for this project.
   > 
   > Perhaps, you could consider setting up a WebDAV server like `apache httpd`[1](https://wiki.archlinux.org/title/WebDAV) in the GitHub action?
   
   Thanks a lot!


-- 
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: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-opendal] Xuanwo commented on a diff in pull request #1783: fix: align WebDAV stat with RFC specification

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
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: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-opendal] bxb100 commented on pull request #1783: fix: align WebDAV stat with RFC specification

Posted by "bxb100 (via GitHub)" <gi...@apache.org>.
bxb100 commented on PR #1783:
URL: https://github.com/apache/incubator-opendal/pull/1783#issuecomment-1486235419

   Thanks review. 
   
   I had been using jianguoyun for self-testing, but it is not suitable for this project.
   
   Perhaps, you could consider setting up a WebDAV server like `apache httpd`[1] in the GitHub action?
   
   [1]: https://wiki.archlinux.org/title/WebDAV


-- 
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: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-opendal] Xuanwo commented on pull request #1783: fix: align WebDAV stat with RFC specification

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on PR #1783:
URL: https://github.com/apache/incubator-opendal/pull/1783#issuecomment-1486225204

   By the way, do you know if there is a WebDAV service accessible to us? I want to add it to our CI integration tests.


-- 
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: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-opendal] Xuanwo merged pull request #1783: fix: align WebDAV stat with RFC specification

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo merged PR #1783:
URL: https://github.com/apache/incubator-opendal/pull/1783


-- 
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: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-opendal] bxb100 commented on pull request #1783: fix: align WebDAV stat with RFC specification

Posted by "bxb100 (via GitHub)" <gi...@apache.org>.
bxb100 commented on PR #1783:
URL: https://github.com/apache/incubator-opendal/pull/1783#issuecomment-1486169524

   PTAL @Xuanwo 


-- 
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: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org