mirror of
https://codeberg.org/git-pages/git-pages.git
synced 2026-05-21 14:41:34 +00:00
Fix file not closed after serving a page.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user