From 2e2e36e0a2b759d5d734bdefc274f127937e9b89 Mon Sep 17 00:00:00 2001 From: Hivert Quentin Date: Mon, 29 Apr 2024 14:21:03 +0200 Subject: [PATCH] fix(attachment): properly download openxmlformats in attachments --- SoObjects/Mailer/SOGoMailBodyPart.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SoObjects/Mailer/SOGoMailBodyPart.m b/SoObjects/Mailer/SOGoMailBodyPart.m index 1f043d335..d641b69f5 100644 --- a/SoObjects/Mailer/SOGoMailBodyPart.m +++ b/SoObjects/Mailer/SOGoMailBodyPart.m @@ -521,8 +521,9 @@ static BOOL debugOn = NO; else if (!asAttachment) mimeType = [self contentTypeForBodyPartInfo: [self partInfo]]; - if([mimeType rangeOfString:@"xml"].location != NSNotFound || [mimeType rangeOfString:@"html"].location != NSNotFound + if(([mimeType rangeOfString:@"xml"].location != NSNotFound || [mimeType rangeOfString:@"html"].location != NSNotFound || [mimeType rangeOfString:@"css"].location != NSNotFound || [mimeType rangeOfString:@"javascript"].location != NSNotFound) + && [mimeType rangeOfString:@"openxmlformats"].location == NSNotFound ) [response setHeader: @"text/plain" forKey: @"content-type"]; else [response setHeader: mimeType forKey: @"content-type"];