Browse Source

auto update script executed

Toby Chui 1 year ago
parent
commit
89b67a5685
1 changed files with 5 additions and 1 deletions
  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 strings.HasSuffix(r.URL.Path, "/") {
 				//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)
 					return
 				}