GODT-2114: sanitize attachment disposition.

This commit is contained in:
Jakub
2022-11-28 17:59:11 +01:00
committed by James Houlahan
parent 8e5040a357
commit b902f1490f
4 changed files with 192 additions and 3 deletions

View File

@ -385,6 +385,11 @@ func createAttachments(
"mime-type": att.MIMEType,
}).Debug("Uploading attachment")
// Some client might have leave empty the content disposition or use unsupported values.
if att.Disposition != string(proton.InlineDisposition) && att.Disposition != string(proton.AttachmentDisposition) {
att.Disposition = string(proton.AttachmentDisposition)
}
// Some clients use inline disposition but don't set a content ID. Our API doesn't support this.
// We could generate our own content ID, but for simplicity, we just set the disposition to attachment.
if att.Disposition == string(proton.InlineDisposition) && att.ContentID == "" {