Forgot to take condition in braces that resulted in returning octet-stream MIME.

This commit is contained in:
Alexander Andreev 2021-02-16 23:57:37 +04:00
parent 830a97b5c0
commit 8e36ac8439
Signed by: Arav
GPG Key ID: 610DF2574456329F
1 changed files with 2 additions and 2 deletions

View File

@ -46,10 +46,10 @@ function sortByNameField(a, b) {
async function fileType(name) {
let f = await FileType.fromStream(fs.createReadStream(name));
if (f === undefined)
if (f === undefined) {
if (name.endsWith("txt"))
return "text/plain";
else
} else
return f.mime;
return "octet-stream";
}