We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fe5266a commit a7cfb9fCopy full SHA for a7cfb9f
modules/context/context.go
@@ -356,8 +356,8 @@ func (ctx *Context) Error(status int, contents ...string) {
356
357
// JSON render content as JSON
358
func (ctx *Context) JSON(status int, content interface{}) {
359
- ctx.Resp.WriteHeader(status)
360
ctx.Resp.Header().Set("Content-Type", "application/json;charset=utf8")
+ ctx.Resp.WriteHeader(status)
361
if err := json.NewEncoder(ctx.Resp).Encode(content); err != nil {
362
ctx.ServerError("Render JSON failed", err)
363
}
0 commit comments