Add new types to supported media types list

This commit is contained in:
silverpill 2023-01-15 02:23:20 +00:00
parent 4d29c83365
commit 3ed610969e
2 changed files with 6 additions and 3 deletions

View file

@ -28,7 +28,7 @@ struct InstanceStatusLimits {
#[derive(Serialize)]
struct InstanceMediaLimits {
supported_mime_types: [&'static str; 4],
supported_mime_types: [&'static str; 7],
image_size_limit: usize,
}

View file

@ -13,11 +13,14 @@ use mime_guess::get_mime_extensions_str;
use mime_sniffer::MimeTypeSniffer;
use sha2::{Digest, Sha256};
pub const SUPPORTED_MEDIA_TYPES: [&str; 4] = [
pub const SUPPORTED_MEDIA_TYPES: [&str; 7] = [
"audio/mpeg",
"image/gif",
"image/jpeg",
"image/png",
"image/gif",
"image/webp",
"video/mp4",
"video/webm",
];
pub fn sniff_media_type(data: &[u8]) -> Option<String> {