a3363b06 by astaxie

json change from Indent to none

1 parent 51e625de
...@@ -216,7 +216,7 @@ func (c *Controller) Abort(code string) { ...@@ -216,7 +216,7 @@ func (c *Controller) Abort(code string) {
216 } 216 }
217 217
218 func (c *Controller) ServeJson(encoding ...bool) { 218 func (c *Controller) ServeJson(encoding ...bool) {
219 content, err := json.MarshalIndent(c.Data["json"], "", " ") 219 content, err := json.Marshal(c.Data["json"])
220 if err != nil { 220 if err != nil {
221 http.Error(c.Ctx.ResponseWriter, err.Error(), http.StatusInternalServerError) 221 http.Error(c.Ctx.ResponseWriter, err.Error(), http.StatusInternalServerError)
222 return 222 return
...@@ -229,7 +229,7 @@ func (c *Controller) ServeJson(encoding ...bool) { ...@@ -229,7 +229,7 @@ func (c *Controller) ServeJson(encoding ...bool) {
229 } 229 }
230 230
231 func (c *Controller) ServeJsonp() { 231 func (c *Controller) ServeJsonp() {
232 content, err := json.MarshalIndent(c.Data["jsonp"], "", " ") 232 content, err := json.Marshal(c.Data["jsonp"])
233 if err != nil { 233 if err != nil {
234 http.Error(c.Ctx.ResponseWriter, err.Error(), http.StatusInternalServerError) 234 http.Error(c.Ctx.ResponseWriter, err.Error(), http.StatusInternalServerError)
235 return 235 return
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!