fix: Attachment converted to links when AWS ACL is public-read, closes #4853

This commit is contained in:
Tom Moor
2023-02-10 17:42:09 -05:00
parent 23b8cc307e
commit bb6f4b1c1e

View File

@@ -102,7 +102,15 @@ router.post(
"Content-Type": contentType,
...presignedPost.fields,
},
attachment: presentAttachment(attachment),
attachment: {
...presentAttachment(attachment),
// always use the redirect url for document attachments, as the serializer
// depends on it to detect attachment vs link
url:
preset === AttachmentPreset.DocumentAttachment
? attachment.redirectUrl
: attachment.url,
},
},
};
}