Skip to content

Commit 7c21109

Browse files
fix
1 parent db5d058 commit 7c21109

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

src/lib/run.js

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,10 +335,26 @@ async function run(
335335

336336
console.log(`Full PATH ${fullPath}`);
337337

338-
if (fullPath.endsWith("/")) {
339-
fullPath += "index.html";
338+
const urlFile = fsOperation(fullPath)
339+
340+
const stats = await urlFile.stat()
341+
342+
if(!stats.exists){
343+
error(reqId)
344+
return
340345
}
341346

347+
if(!stats.isFile){
348+
if (fullPath.endsWith("/")) {
349+
fullPath += "index.html";
350+
}else{
351+
fullPath += "/index.html"
352+
}
353+
}
354+
355+
356+
357+
342358
// Add back the query if present
343359
url = query ? `${fullPath}?${query}` : fullPath;
344360

0 commit comments

Comments
 (0)