From be8b56b8976445a4c3b8737fbf10f001055afb20 Mon Sep 17 00:00:00 2001 From: fancl Date: Fri, 19 Jul 2024 17:37:34 +0800 Subject: [PATCH] fix json encode --- entry/http/context.go | 1 + 1 file changed, 1 insertion(+) diff --git a/entry/http/context.go b/entry/http/context.go index 1c7cbaa..40dffd1 100644 --- a/entry/http/context.go +++ b/entry/http/context.go @@ -122,6 +122,7 @@ func (ctx *Context) Param(k string) string { func (ctx *Context) json(res responsePayload) (err error) { ctx.Response().Header().Set("Content-Type", "application/json") encoder := json.NewEncoder(ctx.Response()) + encoder.SetEscapeHTML(false) if strings.HasPrefix(ctx.Request().Header.Get("User-Agent"), "curl") { encoder.SetIndent("", "\t") }