diff --git a/serve.go b/serve.go index 55327a9..52f2f54 100644 --- a/serve.go +++ b/serve.go @@ -364,7 +364,7 @@ requested, other TLS certificates are requested on demand. for _, e := range tmps { if fi, err := e.Info(); err != nil { log.Errorx("stat tmp file", err, mlog.Field("filename", e.Name())) - } else if now.Sub(fi.ModTime()) > 7*24*time.Hour { + } else if now.Sub(fi.ModTime()) > 7*24*time.Hour && !fi.IsDir() { p := filepath.Join(tmpdir, e.Name()) if err := os.Remove(p); err != nil { log.Errorx("removing stale temporary file", err, mlog.Field("path", p))