97d310b55c
Gin normally silently swallows errors writing to the client; however in WriteJSON (and thus context.JSON), the ResponseWriter was being passed directly into the JSON encoder, which will return an error if there's an error writing to the stream. For instance, context.JSON would panic with errors like "write tcp XXX-> YYY: write: connection reset by peer" if the client disconnected before the response was complete. This change makes JSON.Render() treat write errors the same as IndentedJSON, Data, and other renderers. |
||
---|---|---|
.. | ||
data.go | ||
html.go | ||
json.go | ||
redirect.go | ||
render_test.go | ||
render.go | ||
text.go | ||
xml.go | ||
yaml.go |