1 2 3 4 5
pub fn detect_mimetype(bytes: &[u8]) -> String { infer::get(bytes) .map(|kind| kind.mime_type().to_string()) .unwrap_or_else(|| "application/octet-stream".to_string()) }