mirror of
https://github.com/venera-app/venera.git
synced 2025-09-27 07:47:24 +00:00
fix mime
This commit is contained in:
@@ -10,11 +10,14 @@ class FileType {
|
||||
if(ext.startsWith('.')) {
|
||||
ext = ext.substring(1);
|
||||
}
|
||||
if(ext == 'cbz') {
|
||||
return const FileType('.cbz', 'application/octet-stream');
|
||||
}
|
||||
var mime = lookupMimeType('no-file.$ext');
|
||||
return FileType(".$ext", mime ?? 'application/octet-stream');
|
||||
var mime = lookupMimeType('no-file.$ext') ?? 'application/octet-stream';
|
||||
// Android doesn't support some mime types
|
||||
mime = switch(mime) {
|
||||
'text/javascript' => 'application/javascript',
|
||||
'application/x-cbr' => 'application/octet-stream',
|
||||
_ => mime,
|
||||
};
|
||||
return FileType(".$ext", mime);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user