Skip to content

Commit a1961e0

Browse files
committed
👷 remove x-id parameters
Issue: CLDSRV-867
1 parent fc49bd4 commit a1961e0

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

.github/scripts/cleanupOldGCPBuckets.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function buildClient() {
2727
process.exit(1);
2828
}
2929

30-
return new S3Client({
30+
const client = new S3Client({
3131
endpoint: GCP_ENDPOINT,
3232
region: 'us-east-1',
3333
credentials: { accessKeyId, secretAccessKey },
@@ -36,6 +36,19 @@ function buildClient() {
3636
requestChecksumCalculation: 'WHEN_REQUIRED',
3737
responseChecksumValidation: 'WHEN_REQUIRED',
3838
});
39+
40+
// GCP's S3-compatible API rejects the x-id query parameter that newer
41+
// versions of @aws-sdk/client-s3 append to every request URL.
42+
client.middlewareStack.add(
43+
next => async args => {
44+
// eslint-disable-next-line no-param-reassign
45+
delete args.request.query['x-id'];
46+
return next(args);
47+
},
48+
{ step: 'build', name: 'removeXIdParam', priority: 'low' },
49+
);
50+
51+
return client;
3952
}
4053

4154
async function abortMultipartUploads(client, bucketName) {

0 commit comments

Comments
 (0)