e65d8797 by astaxie

Merge pull request #940 from hilyjiang/develop

make Content-Type header more human-readable
2 parents 802aa161 db04c3cb
...@@ -188,7 +188,7 @@ func sanitizeValue(v string) string { ...@@ -188,7 +188,7 @@ func sanitizeValue(v string) string {
188 // Json writes json to response body. 188 // Json writes json to response body.
189 // if coding is true, it converts utf-8 to \u0000 type. 189 // if coding is true, it converts utf-8 to \u0000 type.
190 func (output *BeegoOutput) Json(data interface{}, hasIndent bool, coding bool) error { 190 func (output *BeegoOutput) Json(data interface{}, hasIndent bool, coding bool) error {
191 output.Header("Content-Type", "application/json;charset=UTF-8") 191 output.Header("Content-Type", "application/json; charset=utf-8")
192 var content []byte 192 var content []byte
193 var err error 193 var err error
194 if hasIndent { 194 if hasIndent {
...@@ -209,7 +209,7 @@ func (output *BeegoOutput) Json(data interface{}, hasIndent bool, coding bool) e ...@@ -209,7 +209,7 @@ func (output *BeegoOutput) Json(data interface{}, hasIndent bool, coding bool) e
209 209
210 // Jsonp writes jsonp to response body. 210 // Jsonp writes jsonp to response body.
211 func (output *BeegoOutput) Jsonp(data interface{}, hasIndent bool) error { 211 func (output *BeegoOutput) Jsonp(data interface{}, hasIndent bool) error {
212 output.Header("Content-Type", "application/javascript;charset=UTF-8") 212 output.Header("Content-Type", "application/javascript; charset=utf-8")
213 var content []byte 213 var content []byte
214 var err error 214 var err error
215 if hasIndent { 215 if hasIndent {
...@@ -235,7 +235,7 @@ func (output *BeegoOutput) Jsonp(data interface{}, hasIndent bool) error { ...@@ -235,7 +235,7 @@ func (output *BeegoOutput) Jsonp(data interface{}, hasIndent bool) error {
235 235
236 // Xml writes xml string to response body. 236 // Xml writes xml string to response body.
237 func (output *BeegoOutput) Xml(data interface{}, hasIndent bool) error { 237 func (output *BeegoOutput) Xml(data interface{}, hasIndent bool) error {
238 output.Header("Content-Type", "application/xml;charset=UTF-8") 238 output.Header("Content-Type", "application/xml; charset=utf-8")
239 var content []byte 239 var content []byte
240 var err error 240 var err error
241 if hasIndent { 241 if hasIndent {
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!