From d096ba486f4c616a139ccf8ee355463c9fa3ba04 Mon Sep 17 00:00:00 2001 From: Chris Aumann Date: Fri, 5 May 2023 02:20:02 +0200 Subject: [PATCH] Remove "millisecond" suffix from getSignedUrl() function (#5302) --- server/models/helpers/DocumentHelper.tsx | 2 +- server/utils/s3.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/models/helpers/DocumentHelper.tsx b/server/models/helpers/DocumentHelper.tsx index 00237921c..6b2578386 100644 --- a/server/models/helpers/DocumentHelper.tsx +++ b/server/models/helpers/DocumentHelper.tsx @@ -298,7 +298,7 @@ export default class DocumentHelper { * * @param text The text either html or markdown which contains urls to be converted * @param teamId The team context - * @param expiresIn The time that signed urls should expire in (ms) + * @param expiresIn The time that signed urls should expire (in seconds) * @returns The replaced text */ static async attachmentsToSignedUrls( diff --git a/server/utils/s3.ts b/server/utils/s3.ts index b8cac6296..f3b5a2116 100644 --- a/server/utils/s3.ts +++ b/server/utils/s3.ts @@ -158,12 +158,12 @@ export const deleteFromS3 = (key: string) => }) .promise(); -export const getSignedUrl = async (key: string, expiresInMs = 60) => { +export const getSignedUrl = async (key: string, expiresIn = 60) => { const isDocker = AWS_S3_UPLOAD_BUCKET_URL.match(/http:\/\/s3:/); const params = { Bucket: AWS_S3_UPLOAD_BUCKET_NAME, Key: key, - Expires: expiresInMs, + Expires: expiresIn, ResponseContentDisposition: "attachment", };