diff --git a/middleware/browse/browse.go b/middleware/browse/browse.go index 321033d5..a3708b11 100644 --- a/middleware/browse/browse.go +++ b/middleware/browse/browse.go @@ -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) diff --git a/middleware/templates/templates.go b/middleware/templates/templates.go index 16678833..8361e465 100644 --- a/middleware/templates/templates.go +++ b/middleware/templates/templates.go @@ -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 {