Cosmetic changes in render

This commit is contained in:
Manu Mtz-Almeida
2015-05-22 04:44:29 +02:00
parent 71bd9f4500
commit 306da81aaf
4 changed files with 13 additions and 5 deletions
+4 -2
View File
@@ -15,13 +15,15 @@ type (
}
)
const jsonContentType = "application/json; charset=utf-8"
func (r JSON) Write(w http.ResponseWriter) error {
w.Header().Set("Content-Type", "application/json; charset=utf-8")
w.Header().Set("Content-Type", jsonContentType)
return json.NewEncoder(w).Encode(r.Data)
}
func (r IndentedJSON) Write(w http.ResponseWriter) error {
w.Header().Set("Content-Type", "application/json; charset=utf-8")
w.Header().Set("Content-Type", jsonContentType)
jsonBytes, err := json.MarshalIndent(r.Data, "", " ")
if err != nil {
return err