소스 검색

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 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
 				}