0
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2024-12-23 22:27:38 -05:00
This commit is contained in:
Matthew Holt 2015-04-21 21:41:43 -06:00
parent 23f7f5ebba
commit 1a8f753303
2 changed files with 1 additions and 2 deletions

View file

@ -181,12 +181,12 @@ func (b Browse) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error) {
Items: fileinfos,
}
// TODO: Use pooled buffers to reduce allocations
var buf bytes.Buffer
err = bc.Template.Execute(&buf, listing)
if err != nil {
return http.StatusInternalServerError, err
}
w.Header().Set("Content-Type", "text/html; charset=utf-8")
buf.WriteTo(w)

View file

@ -48,7 +48,6 @@ func (t Templates) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error
}
// Execute it
// TODO: Use pooled buffers to reduce allocations
var buf bytes.Buffer
err = bc.Template.Execute(&buf, ctx)
if err != nil {