diff options
author | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2022-08-25 12:55:42 +1000 |
---|---|---|
committer | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2022-08-25 13:00:31 +1000 |
commit | d946547a9233d866e793e1c68f11d98cb2f7d390 (patch) | |
tree | 2ff2677432e2e874f0784b115202f3846e68deb0 /src/cdn/util/S3Storage.ts | |
parent | Merge remote-tracking branch 'upstream/staging' into fix/categoryNames (diff) | |
parent | Merge pull request #799 from MaddyUnderStars/feat/captchaVerify (diff) | |
download | server-d946547a9233d866e793e1c68f11d98cb2f7d390.tar.xz |
Merge remote-tracking branch 'upstream/staging' into fix/categoryNames
Also allow voice to skip checks
Diffstat (limited to 'src/cdn/util/S3Storage.ts')
-rw-r--r-- | src/cdn/util/S3Storage.ts | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/cdn/util/S3Storage.ts b/src/cdn/util/S3Storage.ts index c4066817..a7892e5e 100644 --- a/src/cdn/util/S3Storage.ts +++ b/src/cdn/util/S3Storage.ts @@ -11,11 +11,7 @@ const readableToBuffer = (readable: Readable): Promise<Buffer> => }); export class S3Storage implements Storage { - public constructor( - private client: S3, - private bucket: string, - private basePath?: string - ) {} + public constructor(private client: S3, private bucket: string, private basePath?: string) {} /** * Always return a string, to ensure consistency. @@ -28,7 +24,7 @@ export class S3Storage implements Storage { await this.client.putObject({ Bucket: this.bucket, Key: `${this.bucketBasePath}${path}`, - Body: data, + Body: data }); } @@ -36,7 +32,7 @@ export class S3Storage implements Storage { try { const s3Object = await this.client.getObject({ Bucket: this.bucket, - Key: `${this.bucketBasePath ?? ""}${path}`, + Key: `${this.bucketBasePath ?? ""}${path}` }); if (!s3Object.Body) return null; @@ -54,7 +50,7 @@ export class S3Storage implements Storage { async delete(path: string): Promise<void> { await this.client.deleteObject({ Bucket: this.bucket, - Key: `${this.bucketBasePath}${path}`, + Key: `${this.bucketBasePath}${path}` }); } } |