fix(attachment): properly download openxmlformats in attachments

This commit is contained in:
Hivert Quentin
2024-04-29 14:21:03 +02:00
parent 880eb89719
commit 2e2e36e0a2

View File

@@ -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"];