summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/fileserver
diff options
context:
space:
mode:
authorAbdussamet Koçak <sssmmt@gmail.com>2022-08-16 07:31:45 +0300
committerGitHub <noreply@github.com>2022-08-15 22:31:45 -0600
commitdc62d468e9645f52a5e1b4f6093dff65137ab3fe (patch)
tree3ea6243c1ab2d1d54ea66c8881fc4f2f6443ddab /modules/caddyhttp/fileserver
parentc79c08627d36e9871dedd3c7d8889d7d710134c2 (diff)
fileserver: reset buffer before using it (#4962) (#4963)
Diffstat (limited to 'modules/caddyhttp/fileserver')
-rw-r--r--modules/caddyhttp/fileserver/browse.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/modules/caddyhttp/fileserver/browse.go b/modules/caddyhttp/fileserver/browse.go
index da97842..9026356 100644
--- a/modules/caddyhttp/fileserver/browse.go
+++ b/modules/caddyhttp/fileserver/browse.go
@@ -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"], ","))