mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-16 13:22:09 +08:00
Fixed json renderer
This commit is contained in:
parent
3dea0bc95b
commit
d0b7ad21ce
@ -54,8 +54,7 @@ var (
|
||||
|
||||
// Render (JSON) writes data with custom ContentType.
|
||||
func (r JSON) Render(w http.ResponseWriter) (err error) {
|
||||
r.WriteContentType(w)
|
||||
return json.NewEncoder(w).Encode(r.Data)
|
||||
return WriteJSON(w, r.Data)
|
||||
}
|
||||
|
||||
// WriteContentType (JSON) writes JSON ContentType.
|
||||
|
Loading…
x
Reference in New Issue
Block a user