Skip to content

Commit

Permalink
chore: fix assertion getUrl
Browse files Browse the repository at this point in the history
  • Loading branch information
Venkata Ramyasri Kota committed Sep 6, 2023
1 parent 7188d04 commit 97c8a28
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/storage/src/providers/s3/apis/internal/getUrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { resolveS3ConfigAndInput } from '../../utils';
import { assertValidationError } from '../../../../errors/utils/assertValidationError';

const DEFAULT_PRESIGN_EXPIRATION = 900;
const MAX_URL_EXPIRATION = 7 * 24 * 60 * 60 * 1000;

export const getUrl = async function (
amplify: AmplifyClassV6,
Expand All @@ -37,9 +36,8 @@ export const getUrl = async function (
);
urlExpirationInSec = Math.min(awsCredExpirationInSec, urlExpirationInSec);
}

assertValidationError(
urlExpirationInSec < MAX_URL_EXPIRATION,
!(urlExpirationInSec > DEFAULT_PRESIGN_EXPIRATION),
StorageValidationErrorCode.UrlExpirationMaxLimitExceed
);

Expand Down

0 comments on commit 97c8a28

Please sign in to comment.