mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-25 11:22:16 +00:00
Migrate to use jsoniter instead of encoding/json (#14841)
* Migrate to use jsoniter * fix tests * update gitea.com/go-chi/binding Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
parent
59fd641d1f
commit
f0e15250b9
77 changed files with 264 additions and 82 deletions
|
@ -5,7 +5,6 @@
|
|||
package private
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
@ -16,6 +15,7 @@ import (
|
|||
"code.gitea.io/gitea/modules/private"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
"code.gitea.io/gitea/services/mailer"
|
||||
jsoniter "github.com/json-iterator/go"
|
||||
)
|
||||
|
||||
// SendEmail pushes messages to mail queue
|
||||
|
@ -32,6 +32,7 @@ func SendEmail(ctx *context.PrivateContext) {
|
|||
var mail private.Email
|
||||
rd := ctx.Req.Body
|
||||
defer rd.Close()
|
||||
json := jsoniter.ConfigCompatibleWithStandardLibrary
|
||||
if err := json.NewDecoder(rd).Decode(&mail); err != nil {
|
||||
log.Error("%v", err)
|
||||
ctx.JSON(http.StatusInternalServerError, map[string]interface{}{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue