disallow svg MIME types to be inline Content-Disposition

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2024-05-12 03:18:13 -04:00 committed by June
parent 2bd7a92256
commit 829307c83b

View file

@ -16,7 +16,13 @@ pub(crate) fn content_disposition_type(buf: &[u8], _content_type: &Option<String
};
match file_type.matcher_type() {
MatcherType::Image | MatcherType::Audio | MatcherType::Text | MatcherType::Video => "inline",
MatcherType::Image | MatcherType::Audio | MatcherType::Text | MatcherType::Video => {
if file_type.mime_type().contains("svg") {
"attachment"
} else {
"inline"
}
},
_ => "attachment",
}
}