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


##########
core/src/services/supabase/backend.rs:
##########
@@ -259,16 +286,38 @@ impl Accessor for SupabaseBackend {
             return Ok(RpStat::new(Metadata::new(EntryMode::DIR)));
         }
 
-        let resp = self.core.supabase_get_object_info(path).await?;
+        // The get_object_info does not contain the file size. Therefore
+        // we first try the get the metadata through head, if we fail,
+        // we then use get_object_info to get the actual error info
+        let mut resp = self.core.supabase_head_object(path).await?;
 
-        let status = resp.status();
-
-        match status {
+        match resp.status() {
             StatusCode::OK => parse_into_metadata(path, 
resp.headers()).map(RpStat::new),
-            StatusCode::NOT_FOUND if path.ends_with('/') => {
-                Ok(RpStat::new(Metadata::new(EntryMode::DIR)))
+            _ => {
+                resp = self.core.supabase_get_object_info(path).await?;

Review Comment:
   Ok, I got it. You need to parse the json returned by this API instead just 
parse headers.



-- 
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