Skip to content

Commit 844a731

Browse files
fix. infinite loading (#1460)
* fix. infinite loading * format * fix * format
1 parent 6728b4a commit 844a731

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/lib/run.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,23 @@ async function run(
335335

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

338+
const urlFile = fsOperation(fullPath);
339+
340+
const stats = await urlFile.stat();
341+
342+
if (!stats.exists) {
343+
error(reqId);
344+
return;
345+
}
346+
347+
if (!stats.isFile) {
348+
if (fullPath.endsWith("/")) {
349+
fullPath += "index.html";
350+
} else {
351+
fullPath += "/index.html";
352+
}
353+
}
354+
338355
// Add back the query if present
339356
url = query ? `${fullPath}?${query}` : fullPath;
340357

0 commit comments

Comments
 (0)