mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 13:50:54 +00:00
fix #66
This commit is contained in:
parent
951881b96d
commit
b2abb4eb80
@ -212,7 +212,7 @@ func (c *Controller) ServeJson() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
c.Ctx.SetHeader("Content-Length", strconv.Itoa(len(content)), true)
|
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)
|
c.Ctx.ResponseWriter.Write(content)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -223,7 +223,7 @@ func (c *Controller) ServeXml() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
c.Ctx.SetHeader("Content-Length", strconv.Itoa(len(content)), true)
|
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)
|
c.Ctx.ResponseWriter.Write(content)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user