From 629e4d985a012d23a0e761a5834904cfa32e3469 Mon Sep 17 00:00:00 2001 From: joshuaboud Date: Mon, 4 Oct 2021 13:19:03 -0300 Subject: [PATCH] add special case of 1 byte file being application/octet-stream --- navigator/components/NavFile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/navigator/components/NavFile.js b/navigator/components/NavFile.js index e7a9d5a..170138b 100644 --- a/navigator/components/NavFile.js +++ b/navigator/components/NavFile.js @@ -93,7 +93,7 @@ export class NavFile extends NavEntry { var fields = proc_output.split(/:(?=[^:]+$)/); // ensure it's the last : with lookahead var type = fields[1].trim(); - if ((/^text/.test(type) || /^inode\/x-empty$/.test(type) || this.stat["size"] === 0)) { + if (/^text/.test(type) || /^inode\/x-empty$/.test(type) || this.stat["size"] === 0 || (/^application\/octet-stream/.test(type) && this.stat["size"] === 1)) { this.show_edit_file_contents(); } else { console.log("Unknown mimetype: " + type);