瀏覽代碼

auto update script executed

Toby Chui 1 年之前
父節點
當前提交
89b67a5685
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      mod/webserv/middleware.go

+ 5 - 1
mod/webserv/middleware.go

@@ -25,7 +25,11 @@ func (ws *WebServer) fsMiddleware(h http.Handler) http.Handler {
 		if ws.option.EnableDirectoryListing {
 		if ws.option.EnableDirectoryListing {
 			if strings.HasSuffix(r.URL.Path, "/") {
 			if strings.HasSuffix(r.URL.Path, "/") {
 				//This is a folder. Let check if index exists
 				//This is a folder. Let check if index exists
-				if !utils.FileExists(filepath.Join(ws.resolveFileDiskPath(r.URL.Path), "index.html")) {
+				if utils.FileExists(filepath.Join(ws.resolveFileDiskPath(r.URL.Path), "index.html")) {
+
+				} else if utils.FileExists(filepath.Join(ws.resolveFileDiskPath(r.URL.Path), "index.htm")) {
+
+				} else {
 					http.NotFound(w, r)
 					http.NotFound(w, r)
 					return
 					return
 				}
 				}