mirror of
https://github.com/1f349/site-hosting.git
synced 2025-04-12 22:56:02 +01:00
Ensure the storageFs file gets closed
This commit is contained in:
parent
bd87580001
commit
3f2024f58e
@ -169,6 +169,8 @@ func (h *Handler) tryServeFile(rw http.ResponseWriter, req *http.Request, site,
|
||||
open, err := h.storageFs.Open(servePath)
|
||||
switch {
|
||||
case err == nil:
|
||||
defer open.Close()
|
||||
|
||||
// ignore directories
|
||||
stat, err := open.Stat()
|
||||
if err != nil || stat.IsDir() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user