1
0
mirror of https://github.com/astaxie/beego.git synced 2024-06-24 12:34:14 +00:00

json change from Indent to none

This commit is contained in:
astaxie 2013-08-15 22:26:07 +08:00
parent 51e625debf
commit a3363b0605

View File

@ -216,7 +216,7 @@ func (c *Controller) Abort(code string) {
}
func (c *Controller) ServeJson(encoding ...bool) {
content, err := json.MarshalIndent(c.Data["json"], "", " ")
content, err := json.Marshal(c.Data["json"])
if err != nil {
http.Error(c.Ctx.ResponseWriter, err.Error(), http.StatusInternalServerError)
return
@ -229,7 +229,7 @@ func (c *Controller) ServeJson(encoding ...bool) {
}
func (c *Controller) ServeJsonp() {
content, err := json.MarshalIndent(c.Data["jsonp"], "", " ")
content, err := json.Marshal(c.Data["jsonp"])
if err != nil {
http.Error(c.Ctx.ResponseWriter, err.Error(), http.StatusInternalServerError)
return