0
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2025-01-13 22:51:08 -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, Items: fileinfos,
} }
// TODO: Use pooled buffers to reduce allocations
var buf bytes.Buffer var buf bytes.Buffer
err = bc.Template.Execute(&buf, listing) err = bc.Template.Execute(&buf, listing)
if err != nil { if err != nil {
return http.StatusInternalServerError, err return http.StatusInternalServerError, err
} }
w.Header().Set("Content-Type", "text/html; charset=utf-8") w.Header().Set("Content-Type", "text/html; charset=utf-8")
buf.WriteTo(w) buf.WriteTo(w)

View file

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