From 1f196d3a4fb824c9101e7fab0c4d1d3f3fcfb4f3 Mon Sep 17 00:00:00 2001 From: Islam Sharabash Date: Fri, 20 Nov 2020 08:41:05 -0800 Subject: [PATCH] Serve `index.html` when in `app.asar` (#26) --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 23b08bb..8d6d2c4 100644 --- a/index.js +++ b/index.js @@ -38,8 +38,9 @@ module.exports = options => { const indexPath = path.join(options.directory, 'index.html'); const filePath = path.join(options.directory, decodeURIComponent(new URL(request.url).pathname)); const resolvedPath = await getPath(filePath); + const fileExtension = path.extname(filePath); - if (resolvedPath || !path.extname(filePath) || path.extname(filePath) === '.html') { + if (resolvedPath || !fileExtension || fileExtension === '.html' || fileExtension === '.asar') { callback({ path: resolvedPath || indexPath });