mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-26 06:16:56 +09:00
fix: get valid UTF-8 for diff_hunk and composer readme (#39932)
* Fixes #39929 * Fixes #39994 Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
11 files changed
+62
-65
No files matched your search
@@ -114,7 +114,7 @@ func (b *Base) HTTPError(status int, contents ...string) {
|
||||
func (b *Base) JSON(status int, content any) {
|
||||
b.Resp.Header().Set("Content-Type", "application/json;charset=utf-8")
|
||||
b.Resp.WriteHeader(status)
|
||||
if err := json.MarshalWrite(b.Resp, content); err != nil {
|
||||
if err := json.MarshalWriteRelaxed(b.Resp, content); err != nil {
|
||||
log.Error("Render JSON failed: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user