Skip to content

Commit 2de6f26

Browse files
committed
chore: update AWS SDK dependencies to version 3.800.0 and refactor S3 client configuration
1 parent 32c5be9 commit 2de6f26

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

bun.lockb

936 Bytes
Binary file not shown.

server/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
"test:e2e": "bun test ./test/app.e2e-spec.ts"
2323
},
2424
"dependencies": {
25-
"@aws-sdk/client-s3": "^3.717.0",
26-
"@aws-sdk/s3-request-presigner": "^3.717.0",
25+
"@aws-sdk/client-s3": "3.800.0",
26+
"@aws-sdk/s3-request-presigner": "3.800.0",
2727
"@encode42/nbs.js": "^5.0.2",
2828
"@nestjs-modules/mailer": "^2.0.2",
2929
"@nestjs/common": "^10.4.15",

server/src/file/file.service.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,20 @@ export class FileService {
7373
this.region = region;
7474

7575
// Create S3 client
76-
const s3Config = new S3Client({
76+
const s3Client = new S3Client({
7777
region: region,
7878
endpoint: endpoint,
79+
requestChecksumCalculation: endpoint.includes('localhost')
80+
? 'WHEN_REQUIRED'
81+
: undefined,
7982
credentials: {
8083
accessKeyId: key,
8184
secretAccessKey: secret,
8285
},
8386
forcePathStyle: endpoint.includes('localhost') ? true : false,
8487
});
8588

86-
return s3Config;
89+
return s3Client;
8790
}
8891

8992
// Uploads a song to the S3 bucket and returns the key
@@ -245,7 +248,7 @@ export class FileService {
245248
const arrayBuffer = new ArrayBuffer(byteArray.length);
246249
const view = new Uint8Array(arrayBuffer);
247250
for (let i = 0; i < byteArray.length; i++) {
248-
view[i] = byteArray[i];
251+
view[i] = byteArray[i];
249252
}
250253
return arrayBuffer;
251254
} catch (error) {

0 commit comments

Comments
 (0)