1
0
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:
Gerasimos (Makis) Maropoulos
2018-10-18 20:56:41 +03:00
parent df85be52a4
commit 977b67dd47
2 changed files with 52 additions and 53 deletions

View File

@@ -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