"errors"
"fmt"
"io"
+ "io/fs"
"log"
"net"
"net/http"
IndexLookuped:
if fi.IsDir() {
if cfg.DirList {
- entries, err := os.ReadDir(pth)
+ var entries []fs.DirEntry
+ entries, err = os.ReadDir(pth)
if err != nil {
printErr(http.StatusInternalServerError, err)
http.Error(w, "internal error", http.StatusInternalServerError)
http.Error(w, "internal error", http.StatusInternalServerError)
return
}
- etag, err = ctimeETag(fd)
+ etag, err = mtimeETag(fd)
fd.Close()
if err != nil {
printErr(http.StatusInternalServerError, err)
} else {
for _, index := range append(cfg.Indices, Index) {
p := path.Join(pth, index)
- if _, err := os.Stat(p); err == nil {
+ if _, err = os.Stat(p); err == nil {
pth = p
fi, err = os.Stat(pth)
if err != nil {
http.Error(w, "internal error", http.StatusInternalServerError)
return
}
- etag, err = ctimeETag(fd)
+ etag, err = mtimeETag(fd)
if err != nil {
printErr(http.StatusInternalServerError, err)
http.Error(w, "internal error", http.StatusInternalServerError)