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