Fix file not closed after serving a page.

This commit is contained in:
miyuko
2025-09-17 13:00:45 +01:00
parent 3b80cb4144
commit 92622b19a4

View File

@@ -102,6 +102,10 @@ func getPage(w http.ResponseWriter, r *http.Request) error {
break
}
if closer, ok := reader.(io.Closer); ok {
defer closer.Close()
}
// decide on the HTTP status
if is404 {
w.WriteHeader(http.StatusNotFound)