File tree Expand file tree Collapse file tree 1 file changed +14
-13
lines changed Expand file tree Collapse file tree 1 file changed +14
-13
lines changed Original file line number Diff line number Diff line change @@ -268,23 +268,24 @@ pub async fn compute_aws_sigv4_payload(
268
268
Error :: authentication_error ( MECH_NAME , & format ! ( "Failed to build signing params: {e}" ) )
269
269
} ) ?
270
270
. into ( ) ;
271
+ let headers: Result < Vec < _ > > = request
272
+ . headers ( )
273
+ . iter ( )
274
+ . map ( |( k, v) | {
275
+ let v = v. to_str ( ) . map_err ( |_| {
276
+ Error :: authentication_error (
277
+ MECH_NAME ,
278
+ "Failed to convert header value to valid UTF-8" ,
279
+ )
280
+ } ) ?;
281
+ Ok ( ( k. as_str ( ) , v) )
282
+ } )
283
+ . collect ( ) ;
271
284
272
285
let signable_request = SignableRequest :: new (
273
286
request. method ( ) . as_str ( ) ,
274
287
request. uri ( ) . to_string ( ) ,
275
- request
276
- . headers ( )
277
- . iter ( )
278
- . map ( |( k, v) | {
279
- let value = std:: str:: from_utf8 ( v. as_bytes ( ) ) . map_err ( |_| {
280
- Error :: authentication_error (
281
- MECH_NAME ,
282
- "Failed to convert header value to valid UTF-8" ,
283
- )
284
- } ) ?;
285
- Ok ( ( k. as_str ( ) , value) )
286
- } )
287
- . filter_map ( Result :: ok) ,
288
+ headers?. into_iter ( ) ,
288
289
SignableBody :: Bytes ( request. body ( ) . as_bytes ( ) ) ,
289
290
)
290
291
. map_err ( |e| {
You can’t perform that action at this time.
0 commit comments