Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const getObjectUrl = async (fileName: string) => {
const request = await createRequest(
s3Client,
new GetObjectCommand({
Key: fileName,
Bucket: config.s3Bucket
})
);
const signer = new S3RequestPresigner({
...s3Client.config
});
const url = await signer.presignRequest(
request,
new Date(Date.now() + 60 * 60 * 1000)
);
// @ts-ignore
return formatUrl(url);
};