master
兔子 2 years ago
parent 7f73bb3d4d
commit c485d070a3

@ -403,10 +403,10 @@ func (h *HttpServer) Listen(w http.ResponseWriter, r *http.Request) {
return
}
fullpath := filepath.Join(h.envPath, path)
if path == "/" && h.indexFile != "" {
if staros.Exists(filepath.Join(h.envPath, h.indexFile)) {
fullpath = filepath.Join(h.envPath, h.indexFile)
path = "/" + h.indexFile
if h.indexFile != "" && staros.IsFolder(fullpath) {
if staros.Exists(filepath.Join(fullpath, h.indexFile)) {
fullpath = filepath.Join(fullpath, h.indexFile)
path = filepath.Join(path, h.indexFile)
}
}
log.Noticef("Start Method:%s Path:%s IP:%s\n", r.Method, path, r.RemoteAddr)

Loading…
Cancel
Save