Skip to content

Commit 81e5221

Browse files
committed
test(middleware-sdk-ec2): undo content length change
1 parent 08f9f21 commit 81e5221

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

packages/middleware-sdk-ec2/src/index.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { SignatureV4 } from "@smithy/signature-v4";
55
import { extendedEncodeURIComponent } from "@smithy/smithy-client";
66
import type {
77
AwsCredentialIdentity,
8-
BodyLengthCalculator,
98
ChecksumConstructor,
109
Endpoint,
1110
HandlerExecutionContext,
@@ -30,7 +29,6 @@ interface PreviouslyResolved {
3029
sha256: ChecksumConstructor | HashConstructor;
3130
signingEscapePath: boolean;
3231
regionInfoProvider?: RegionInfoProvider;
33-
bodyLengthChecker: BodyLengthCalculator;
3432
}
3533

3634
const version = "2016-11-15";
@@ -125,9 +123,6 @@ export function copySnapshotPresignedUrlMiddleware(options: PreviouslyResolved):
125123
if (!(request.body ?? "").includes("PresignedUrl=")) {
126124
request.body += `&PresignedUrl=${extendedEncodeURIComponent(args.input.PresignedUrl)}`;
127125
}
128-
if (typeof options.bodyLengthChecker === "function") {
129-
request.headers["content-length"] = String(options.bodyLengthChecker(request.body));
130-
}
131126
}
132127
}
133128

packages/middleware-sdk-ec2/src/middleware-sdk-ec2.e2e.spec.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { EC2, EC2ServiceException, waitUntilSnapshotCompleted, waitUntilVolumeAvailable } from "@aws-sdk/client-ec2";
22
import { KMS } from "@aws-sdk/client-kms";
3+
import { getHttpDebugLogPlugin } from "@aws-sdk/middleware-http-debug-log";
34
import { afterAll, beforeAll, describe, expect, onTestFailed, test as it } from "vitest";
45

56
const errors = [] as any[];
@@ -108,6 +109,14 @@ describe("EC2 feature test", () => {
108109
const sourceKms = new KMS({ region: sourceRegion, logger });
109110
const destinationKms = new KMS({ region: destRegion, logger });
110111

112+
for (const client of [sourceEc2, destinationEc2, sourceKms, destinationKms]) {
113+
// I'm leaving this debug call in the test because it's so slow that
114+
// you will want to see active request progress.
115+
void getHttpDebugLogPlugin;
116+
void client;
117+
// client.middlewareStack.use(getHttpDebugLogPlugin("line"));
118+
}
119+
111120
async function teardown() {
112121
if (volumeId) {
113122
await sourceEc2.deleteVolume({ VolumeId: volumeId });

0 commit comments

Comments
 (0)