Skip to content

Commit e6906fc

Browse files
committed
fix index.html mapping to directory root
1 parent c93b58d commit e6906fc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

server/handler.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ func (h *Handler) MapDir(dirPath string) error {
7878
path = strings.ReplaceAll(path, dirPath, "")
7979

8080
if d.IsDir() {
81+
if !strings.HasSuffix(path, "/") && len(path) != 0 {
82+
path = path + "/"
83+
}
84+
8185
h.PathMap["/"+path] = dirPath + path + "index.html"
8286
logger.GlobalLog.LogInfo("Mapped URI '/" + path + "index.html' to file '" + dirPath + path + "'")
8387
} else {

0 commit comments

Comments
 (0)