Skip to content

Commit

Permalink
fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
yuqingc committed May 21, 2019
1 parent 59f6c41 commit 8f016b2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion http/file_server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ async function serveDir(
// dirname has no prefix
const listEntry: string[] = [];
const fileInfos = await readDir(dirPath);
dirPth = dirPath.replace(currentDir, "");
for (const info of fileInfos) {
let fn = dirPath + "/" + info.name;
if (info.name === "index.html" && info.isFile()) {
Expand All @@ -162,7 +163,7 @@ async function serveDir(
listEntry.push(
createDirEntryDisplay(
info.name,
fn.replace(currentDir, ''),
fn,
info.isFile() ? info.len : null,
mode,
info.isDirectory()
Expand Down

0 comments on commit 8f016b2

Please sign in to comment.