This is an automated email from the ASF dual-hosted git repository.

xuanwo pushed a commit to branch fix-stat
in repository https://gitbox.apache.org/repos/asf/incubator-opendal.git

commit 6e778e5c71de5e91fd1b67a101c7c78ac5d57259
Author: Xuanwo <[email protected]>
AuthorDate: Wed Nov 22 19:16:50 2023 +0800

    Fix ghac
    
    Signed-off-by: Xuanwo <[email protected]>
---
 core/src/services/ghac/backend.rs | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/core/src/services/ghac/backend.rs 
b/core/src/services/ghac/backend.rs
index 92d105892..fb14b280d 100644
--- a/core/src/services/ghac/backend.rs
+++ b/core/src/services/ghac/backend.rs
@@ -369,12 +369,15 @@ impl Accessor for GhacBackend {
             let query_resp: GhacQueryResponse =
                 
serde_json::from_slice(&slc).map_err(new_json_deserialize_error)?;
             query_resp.archive_location
-        } else if resp.status() == StatusCode::NO_CONTENT && 
path.ends_with('/') {
-            return Ok(RpStat::new(Metadata::new(EntryMode::DIR)));
         } else {
             return Err(parse_error(resp).await?);
         };
 
+        // If the query matches a location and path is ends with `/`, we can 
return directly.
+        if path.ends_with('/') {
+            return Ok(RpStat::new(Metadata::new(EntryMode::DIR)));
+        }
+
         let req = self.ghac_head_location(&location).await?;
         let resp = self.client.send(req).await?;
 

Reply via email to