095e52b9 by astaxie

fix #43

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