From 352868ef90d00bd52ad174de8cfea9027dfd5de6 Mon Sep 17 00:00:00 2001 From: Manu Mtz-Almeida Date: Sat, 13 Jun 2015 04:43:23 +0200 Subject: [PATCH] Add support for custom HTML and XML content-type --- render/html.go | 2 +- render/xml.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/render/html.go b/render/html.go index 3595ec5a..01f6bf22 100644 --- a/render/html.go +++ b/render/html.go @@ -58,7 +58,7 @@ func (r HTMLDebug) loadTemplate() *template.Template { } func (r HTML) Render(w http.ResponseWriter) error { - w.Header()["Content-Type"] = htmlContentType + writeContentType(w, htmlContentType) if len(r.Name) == 0 { return r.Template.Execute(w, r.Data) } else { diff --git a/render/xml.go b/render/xml.go index eac0589f..be22e6f2 100644 --- a/render/xml.go +++ b/render/xml.go @@ -16,6 +16,6 @@ type XML struct { var xmlContentType = []string{"application/xml; charset=utf-8"} func (r XML) Render(w http.ResponseWriter) error { - w.Header()["Content-Type"] = xmlContentType + writeContentType(w, xmlContentType) return xml.NewEncoder(w).Encode(r.Data) }