mirror of
https://github.com/astaxie/beego.git
synced 2024-12-22 22:50:50 +00:00
fix #66
This commit is contained in:
parent
951881b96d
commit
b2abb4eb80
@ -212,7 +212,7 @@ func (c *Controller) ServeJson() {
|
||||
return
|
||||
}
|
||||
c.Ctx.SetHeader("Content-Length", strconv.Itoa(len(content)), true)
|
||||
c.Ctx.ResponseWriter.Header().Set("Content-Type", "application/json")
|
||||
c.Ctx.ResponseWriter.Header().Set("Content-Type", "application/json;charset=UTF-8")
|
||||
c.Ctx.ResponseWriter.Write(content)
|
||||
}
|
||||
|
||||
@ -223,7 +223,7 @@ func (c *Controller) ServeXml() {
|
||||
return
|
||||
}
|
||||
c.Ctx.SetHeader("Content-Length", strconv.Itoa(len(content)), true)
|
||||
c.Ctx.ResponseWriter.Header().Set("Content-Type", "application/xml")
|
||||
c.Ctx.ResponseWriter.Header().Set("Content-Type", "application/xml;charset=UTF-8")
|
||||
c.Ctx.ResponseWriter.Write(content)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user