Forgot to take condition in braces that resulted in returning octet-stream MIME.
This commit is contained in:
parent
830a97b5c0
commit
8e36ac8439
4
files.js
4
files.js
@ -46,10 +46,10 @@ function sortByNameField(a, b) {
|
|||||||
|
|
||||||
async function fileType(name) {
|
async function fileType(name) {
|
||||||
let f = await FileType.fromStream(fs.createReadStream(name));
|
let f = await FileType.fromStream(fs.createReadStream(name));
|
||||||
if (f === undefined)
|
if (f === undefined) {
|
||||||
if (name.endsWith("txt"))
|
if (name.endsWith("txt"))
|
||||||
return "text/plain";
|
return "text/plain";
|
||||||
else
|
} else
|
||||||
return f.mime;
|
return f.mime;
|
||||||
return "octet-stream";
|
return "octet-stream";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user