Commit 1a8f7533 authored by Matthew Holt's avatar Matthew Holt

Meh.

parent 23f7f5eb
......@@ -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)
......
......@@ -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 {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment