095e52b9 by astaxie

fix #43

1 parent b6f06a55
...@@ -199,7 +199,7 @@ func (c *Controller) ServeJson() { ...@@ -199,7 +199,7 @@ func (c *Controller) ServeJson() {
199 return 199 return
200 } 200 }
201 c.Ctx.SetHeader("Content-Length", strconv.Itoa(len(content)), true) 201 c.Ctx.SetHeader("Content-Length", strconv.Itoa(len(content)), true)
202 c.Ctx.ContentType("json") 202 ctx.ResponseWriter.Header().Set("Content-Type", "application/json")
203 c.Ctx.ResponseWriter.Write(content) 203 c.Ctx.ResponseWriter.Write(content)
204 } 204 }
205 205
...@@ -210,7 +210,7 @@ func (c *Controller) ServeXml() { ...@@ -210,7 +210,7 @@ func (c *Controller) ServeXml() {
210 return 210 return
211 } 211 }
212 c.Ctx.SetHeader("Content-Length", strconv.Itoa(len(content)), true) 212 c.Ctx.SetHeader("Content-Length", strconv.Itoa(len(content)), true)
213 c.Ctx.ContentType("xml") 213 ctx.ResponseWriter.Header().Set("Content-Type", "application/xml")
214 c.Ctx.ResponseWriter.Write(content) 214 c.Ctx.ResponseWriter.Write(content)
215 } 215 }
216 216
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!