File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -618,7 +618,12 @@ impl StorageBackend for AzureBlobStorageBackend {
618618 }
619619
620620 // The prefix should end with `/` to signify a directory.
621- prefix. push ( '/' ) ;
621+ if !prefix. ends_with ( '/' ) {
622+ prefix. push ( '/' ) ;
623+ }
624+
625+ dbg ! ( & container) ;
626+ dbg ! ( & prefix) ;
622627
623628 {
624629 // Append the operation and block id to the URL
@@ -664,6 +669,8 @@ impl StorageBackend for AzureBlobStorageBackend {
664669 }
665670 } ;
666671
672+ dbg ! ( & results) ;
673+
667674 // If there is only one result and the result is an empty path, then the given
668675 // URL was to a file and not a "directory"
669676 if paths. is_empty ( )
Original file line number Diff line number Diff line change @@ -677,10 +677,12 @@ impl StorageBackend for GoogleStorageBackend {
677677
678678 let ( bucket, path) = url. bucket_and_path ( ) ;
679679
680- // The prefix should end with `/` to signify a directory.
681680 let mut prefix = path. strip_prefix ( '/' ) . unwrap_or ( path) . to_string ( ) ;
682- prefix. push ( '/' ) ;
683-
681+ // The prefix should end with `/` to signify a directory.
682+ if !prefix. ends_with ( '/' ) {
683+ prefix. push ( '/' ) ;
684+ }
685+
684686 // Format the request to always use the virtual-host style URL
685687 url. set_host ( Some ( & format ! ( "{bucket}.{GOOGLE_ROOT_DOMAIN}" ) ) )
686688 . map_err ( |_| GoogleError :: InvalidBucketName ) ?;
Original file line number Diff line number Diff line change @@ -759,10 +759,12 @@ impl StorageBackend for S3StorageBackend {
759759
760760 let ( bucket, path) = url. bucket_and_path ( ) ;
761761
762- // The prefix should end with `/` to signify a directory.
763762 let mut prefix = path. strip_prefix ( '/' ) . unwrap_or ( path) . to_string ( ) ;
764- prefix. push ( '/' ) ;
765-
763+ // The prefix should end with `/` to signify a directory.
764+ if !prefix. ends_with ( '/' ) {
765+ prefix. push ( '/' ) ;
766+ }
767+
766768 // Format the request to always use the virtual-host style URL
767769 let domain = url. domain ( ) . expect ( "URL should have domain" ) ;
768770 if domain. starts_with ( "s3" ) || domain. starts_with ( "S3" ) {
You can’t perform that action at this time.
0 commit comments