This commit is contained in:
Łukasz Magiera 2021-04-01 16:40:11 +02:00
parent c7de7882a1
commit f372964a60

View File

@ -117,7 +117,11 @@ func (handler *FetchHandler) remoteGetSector(w http.ResponseWriter, r *http.Requ
return return
} }
if !stat.IsDir() { if !stat.IsDir() {
defer rd.(*os.File).Close() defer func() {
if err := rd.(*os.File).Close(); err != nil {
log.Errorf("closing source file: %+v", err)
}
}()
} }
w.WriteHeader(200) w.WriteHeader(200)