2
0

🚑 Move cache control header into the post policy

This commit is contained in:
Baptiste Arnaud
2023-11-02 14:43:49 +01:00
parent bdf9faea78
commit a855d85d04
7 changed files with 5 additions and 6 deletions

View File

@ -34,6 +34,8 @@ export const generatePresignedPostPolicy = async ({
postPolicy.setKey(filePath)
postPolicy.setBucket(env.S3_BUCKET)
postPolicy.setExpires(new Date(Date.now() + tenMinutes * 1000))
postPolicy.formData['Cache-Control'] = 'max-age=86400'
postPolicy.policy.conditions.push(['eq', '$Cache-Control', 'max-age=86400'])
if (fileType) postPolicy.setContentType(fileType)
return minioClient.presignedPostPolicy(postPolicy)