mirror of
https://github.com/kataras/iris.git
synced 2026-01-22 19:36:00 +00:00
add a HISTORY note about the Context#ReadForm return error
Former-commit-id: ae423978262575d21d098f1ca2986de05d0cda49
This commit is contained in:
@@ -2864,12 +2864,10 @@ func (ctx *context) JSON(v interface{}, opts ...JSON) (n int, err error) {
|
||||
options = opts[0]
|
||||
}
|
||||
|
||||
optimize := ctx.shouldOptimize()
|
||||
|
||||
ctx.ContentType(ContentJSONHeaderValue)
|
||||
|
||||
if options.StreamingJSON {
|
||||
if optimize {
|
||||
if ctx.shouldOptimize() {
|
||||
var jsoniterConfig = jsoniter.Config{
|
||||
EscapeHTML: !options.UnescapeHTML,
|
||||
IndentionStep: 4,
|
||||
@@ -2890,7 +2888,7 @@ func (ctx *context) JSON(v interface{}, opts ...JSON) (n int, err error) {
|
||||
return ctx.writer.Written(), err
|
||||
}
|
||||
|
||||
n, err = WriteJSON(ctx.writer, v, options, optimize)
|
||||
n, err = WriteJSON(ctx.writer, v, options, ctx.shouldOptimize())
|
||||
if err != nil {
|
||||
ctx.StatusCode(http.StatusInternalServerError)
|
||||
return 0, err
|
||||
|
||||
Reference in New Issue
Block a user