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";
5
5
import { extendedEncodeURIComponent } from "@smithy/smithy-client" ;
6
6
import type {
7
7
AwsCredentialIdentity ,
8
+ BodyLengthCalculator ,
8
9
ChecksumConstructor ,
9
10
Endpoint ,
10
11
HandlerExecutionContext ,
@@ -29,6 +30,7 @@ interface PreviouslyResolved {
29
30
sha256 : ChecksumConstructor | HashConstructor ;
30
31
signingEscapePath : boolean ;
31
32
regionInfoProvider ?: RegionInfoProvider ;
33
+ bodyLengthChecker : BodyLengthCalculator ;
32
34
}
33
35
34
36
const version = "2016-11-15" ;
@@ -123,6 +125,9 @@ export function copySnapshotPresignedUrlMiddleware(options: PreviouslyResolved):
123
125
if ( ! ( request . body ?? "" ) . includes ( "PresignedUrl=" ) ) {
124
126
request . body += `&PresignedUrl=${ extendedEncodeURIComponent ( args . input . PresignedUrl ) } ` ;
125
127
}
128
+ if ( typeof options . bodyLengthChecker === "function" ) {
129
+ request . headers [ "content-length" ] = String ( options . bodyLengthChecker ( request . body ) ) ;
130
+ }
126
131
}
127
132
}
128
133
You can’t perform that action at this time.
0 commit comments