diff options
Diffstat (limited to 'http')
| -rwxr-xr-x | http/file_server.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/http/file_server.ts b/http/file_server.ts index 6a3fb9e45..21482e747 100755 --- a/http/file_server.ts +++ b/http/file_server.ts @@ -149,19 +149,20 @@ async function serveDir( const listEntry: string[] = []; const fileInfos = await readDir(dirPath); for (const info of fileInfos) { + let fn = dirPath + "/" + info.name; if (info.name === "index.html" && info.isFile()) { // in case index.html as dir... - return await serveFile(req, info.path); + return await serveFile(req, fn); } // Yuck! let mode = null; try { - mode = (await stat(info.path)).mode; + mode = (await stat(fn)).mode; } catch (e) {} listEntry.push( createDirEntryDisplay( info.name, - dirName + "/" + info.name, + fn, info.isFile() ? info.len : null, mode, info.isDirectory() |
