File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed 
packages/middleware-sdk-ec2/src Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import { SignatureV4 } from "@smithy/signature-v4";
55import  {  extendedEncodeURIComponent  }  from  "@smithy/smithy-client" ; 
66import  type  { 
77  AwsCredentialIdentity , 
8+   BodyLengthCalculator , 
89  ChecksumConstructor , 
910  Endpoint , 
1011  HandlerExecutionContext , 
@@ -29,6 +30,7 @@ interface PreviouslyResolved {
2930  sha256 : ChecksumConstructor  |  HashConstructor ; 
3031  signingEscapePath : boolean ; 
3132  regionInfoProvider ?: RegionInfoProvider ; 
33+   bodyLengthChecker : BodyLengthCalculator ; 
3234} 
3335
3436const  version  =  "2016-11-15" ; 
@@ -123,6 +125,9 @@ export function copySnapshotPresignedUrlMiddleware(options: PreviouslyResolved):
123125          if  ( ! ( request . body  ??  "" ) . includes ( "PresignedUrl=" ) )  { 
124126            request . body  +=  `&PresignedUrl=${ extendedEncodeURIComponent ( args . input . PresignedUrl ) }  ; 
125127          } 
128+           if  ( typeof  options . bodyLengthChecker  ===  "function" )  { 
129+             request . headers [ "content-length" ]  =  String ( options . bodyLengthChecker ( request . body ) ) ; 
130+           } 
126131        } 
127132      } 
128133
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments