Commit a2661e4 1 parent 20891ae commit a2661e4 Copy full SHA for a2661e4
File tree 2 files changed +13
-2
lines changed
2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ hashbrown = "0.13"
58
58
itertools = " 0.10"
59
59
libloading = " 0.7.3"
60
60
log = " 0.4"
61
- object_store = " 0.5.0 "
61
+ object_store = " 0.5.2 "
62
62
once_cell = " 1.9.0"
63
63
64
64
parking_lot = " 0.12"
Original file line number Diff line number Diff line change @@ -99,13 +99,24 @@ impl ObjectStoreProvider for FeatureBasedObjectStoreProvider {
99
99
100
100
#[ cfg( feature = "s3" ) ]
101
101
{
102
- if url. to_string ( ) . starts_with ( "s3://" ) {
102
+ if url. as_str ( ) . starts_with ( "s3://" ) {
103
103
if let Some ( bucket_name) = url. host_str ( ) {
104
104
let store = AmazonS3Builder :: from_env ( )
105
105
. with_bucket_name ( bucket_name)
106
106
. build ( ) ?;
107
107
return Ok ( Arc :: new ( store) ) ;
108
108
}
109
+ // Support Alibaba Cloud OSS
110
+ // Use S3 compatibility mode to access Alibaba Cloud OSS
111
+ // The `AWS_ENDPOINT` should have bucket name included
112
+ } else if url. as_str ( ) . starts_with ( "oss://" ) {
113
+ if let Some ( bucket_name) = url. host_str ( ) {
114
+ let store = AmazonS3Builder :: from_env ( )
115
+ . with_virtual_hosted_style_request ( true )
116
+ . with_bucket_name ( bucket_name)
117
+ . build ( ) ?;
118
+ return Ok ( Arc :: new ( store) ) ;
119
+ }
109
120
}
110
121
}
111
122
You can’t perform that action at this time.
0 commit comments