From f5ca3c990c69503f3389f8d7a5938a5fa9479949 Mon Sep 17 00:00:00 2001 From: Venkata Ramyasri Kota Date: Tue, 5 Sep 2023 17:47:07 -0700 Subject: [PATCH] chore: change import statements --- .../storage/src/providers/s3/apis/internal/getUrl.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/storage/src/providers/s3/apis/internal/getUrl.ts b/packages/storage/src/providers/s3/apis/internal/getUrl.ts index 39a7aa101ca..6ef23c32f64 100644 --- a/packages/storage/src/providers/s3/apis/internal/getUrl.ts +++ b/packages/storage/src/providers/s3/apis/internal/getUrl.ts @@ -10,9 +10,10 @@ import { getPresignedGetObjectUrl } from '../../utils/client'; import { getProperties } from './getProperties'; import { resolveS3ConfigAndInput } from '../../utils'; import { assertValidationError } from '../../../../errors/utils/assertValidationError'; - -const DEFAULT_PRESIGN_EXPIRATION = 900; -const MAX_URL_EXPIRATION = 900; +import { + DEFAULT_PRESIGN_EXPIRATION, + MAX_URL_EXPIRATION, +} from '../../utils/constants'; export const getUrl = async function ( amplify: AmplifyClassV6, @@ -37,8 +38,9 @@ export const getUrl = async function ( ); urlExpirationInSec = Math.min(awsCredExpirationInSec, urlExpirationInSec); } + const maxUrlExpirationInSec = MAX_URL_EXPIRATION / 1000; assertValidationError( - !(urlExpirationInSec > MAX_URL_EXPIRATION), + !(urlExpirationInSec > maxUrlExpirationInSec), StorageValidationErrorCode.UrlExpirationMaxLimitExceed );