fileserver: reset buffer before using it (#4962) (#4963)

This commit is contained in:
Abdussamet Koçak authored and GitHub committed 2022-08-15 22:31:45 -06:00
1 parent c79c08627d
commit dc62d468e9
1 file changed
+1
+1
View File
@@ -94,6 +94,7 @@ func (fsrv *FileServer) serveBrowse(root, dirPath string, w http.ResponseWriter,
fsrv.browseApplyQueryParams(w, r, &listing)
buf := bufPool.Get().(*bytes.Buffer)
buf.Reset()
defer bufPool.Put(buf)
acceptHeader := strings.ToLower(strings.Join(r.Header["Accept"], ","))