mirror of
https://github.com/astaxie/beego.git
synced 2024-12-22 21:30:49 +00:00
fix #43
This commit is contained in:
parent
b6f06a5559
commit
095e52b941
@ -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)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user