@@ -36,8 +36,8 @@ use crate::client::{GetOptionsExt, HttpClient, HttpError, HttpResponse};
3636use crate :: list:: { PaginatedListOptions , PaginatedListResult } ;
3737use crate :: multipart:: PartId ;
3838use crate :: {
39- Attribute , Attributes , ClientOptions , GetOptions , MultipartId , Path , PutMultipartOptions ,
40- PutPayload , PutResult , Result , RetryConfig , TagSet ,
39+ Attribute , Attributes , ClientOptions , GetOptions , ListResult , MultipartId , Path ,
40+ PutMultipartOptions , PutPayload , PutResult , Result , RetryConfig , TagSet ,
4141} ;
4242use async_trait:: async_trait;
4343use base64:: Engine ;
@@ -470,8 +470,10 @@ impl Request<'_> {
470470
471471 pub ( crate ) async fn do_put ( self ) -> Result < PutResult > {
472472 let response = self . send ( ) . await ?;
473- Ok ( get_put_result ( response. headers ( ) , VERSION_HEADER )
474- . map_err ( |source| Error :: Metadata { source } ) ?)
473+ Ok (
474+ get_put_result ( response, VERSION_HEADER )
475+ . map_err ( |source| Error :: Metadata { source } ) ?,
476+ )
475477 }
476478}
477479
@@ -857,11 +859,12 @@ impl S3Client {
857859 path : location. as_ref ( ) . to_string ( ) ,
858860 } ) ?;
859861
860- let version = get_version ( response. headers ( ) , VERSION_HEADER )
862+ let ( parts, body) = response. into_parts ( ) ;
863+
864+ let version = get_version ( & parts. headers , VERSION_HEADER )
861865 . map_err ( |source| Error :: Metadata { source } ) ?;
862866
863- let data = response
864- . into_body ( )
867+ let data = body
865868 . bytes ( )
866869 . await
867870 . map_err ( |source| Error :: CompleteMultipartResponseBody { source } ) ?;
@@ -872,6 +875,7 @@ impl S3Client {
872875 Ok ( PutResult {
873876 e_tag : Some ( response. e_tag ) ,
874877 version,
878+ extensions : parts. extensions ,
875879 } )
876880 }
877881
@@ -993,8 +997,11 @@ impl ListClient for Arc<S3Client> {
993997 . with_aws_sigv4 ( credential. authorizer ( ) , None )
994998 . send_retry ( & self . config . retry_config )
995999 . await
996- . map_err ( |source| Error :: ListRequest { source } ) ?
997- . into_body ( )
1000+ . map_err ( |source| Error :: ListRequest { source } ) ?;
1001+
1002+ let ( parts, body) = response. into_parts ( ) ;
1003+
1004+ let response = body
9981005 . bytes ( )
9991006 . await
10001007 . map_err ( |source| Error :: ListResponseBody { source } ) ?;
@@ -1004,8 +1011,11 @@ impl ListClient for Arc<S3Client> {
10041011
10051012 let token = response. next_continuation_token . take ( ) ;
10061013
1014+ let mut result: ListResult = response. try_into ( ) ?;
1015+ result. extensions = parts. extensions ;
1016+
10071017 Ok ( PaginatedListResult {
1008- result : response . try_into ( ) ? ,
1018+ result,
10091019 page_token : token,
10101020 } )
10111021 }
0 commit comments