@@ -231,6 +231,11 @@ impl Request<'_> {
231
231
}
232
232
}
233
233
234
+ fn with_extensions ( self , extensions : :: http:: Extensions ) -> Self {
235
+ let builder = self . builder . extensions ( extensions) ;
236
+ Self { builder, ..self }
237
+ }
238
+
234
239
async fn send ( self ) -> Result < HttpResponse > {
235
240
let credential = self . config . credentials . get_credential ( ) . await ?;
236
241
let resp = self
@@ -384,12 +389,21 @@ impl GoogleCloudStorageClient {
384
389
payload : PutPayload ,
385
390
opts : PutOptions ,
386
391
) -> Result < PutResult > {
392
+ let PutOptions {
393
+ mode,
394
+ // not supported by GCP
395
+ tags : _,
396
+ attributes,
397
+ extensions,
398
+ } = opts;
399
+
387
400
let builder = self
388
401
. request ( Method :: PUT , path)
389
402
. with_payload ( payload)
390
- . with_attributes ( opts. attributes ) ;
403
+ . with_attributes ( attributes)
404
+ . with_extensions ( extensions) ;
391
405
392
- let builder = match & opts . mode {
406
+ let builder = match & mode {
393
407
PutMode :: Overwrite => builder. idempotent ( true ) ,
394
408
PutMode :: Create => builder. header ( & VERSION_MATCH , "0" ) ,
395
409
PutMode :: Update ( v) => {
@@ -398,7 +412,7 @@ impl GoogleCloudStorageClient {
398
412
}
399
413
} ;
400
414
401
- match ( opts . mode , builder. do_put ( ) . await ) {
415
+ match ( mode, builder. do_put ( ) . await ) {
402
416
( PutMode :: Create , Err ( crate :: Error :: Precondition { path, source } ) ) => {
403
417
Err ( crate :: Error :: AlreadyExists { path, source } )
404
418
}
0 commit comments