Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Mirrored from https://github.com/Slazee/caddy.git
Synced Nov 13, 15:30 UTC
fileserver: reset buffer before using it (#4962) (#4963)
Abdussamet Koçak committed
Aug 16, 2022 at 07:31 UTC
dc62d468e9645f52a5e1b4f6093dff65137ab3fe
1 file changed
+1
modules/caddyhttp/fileserver/browse.go
+1
@@ -94,6 +94,7 @@ func (fsrv *FileServer) serveBrowse(root, dirPath string, w http.ResponseWriter,
94
fsrv.browseApplyQueryParams(w, r, &listing)
95
96
buf := bufPool.Get().(*bytes.Buffer)
97
+ buf.Reset()
98
defer bufPool.Put(buf)
99
100
acceptHeader := strings.ToLower(strings.Join(r.Header["Accept"], ","))