summaryrefslogtreecommitdiffstats
path: root/models/webhook.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/webhook.go')
-rw-r--r--models/webhook.go7
1 files changed, 1 insertions, 6 deletions
diff --git a/models/webhook.go b/models/webhook.go
index 9c8c0a568b..138ba26bde 100644
--- a/models/webhook.go
+++ b/models/webhook.go
@@ -11,13 +11,13 @@ import (
"strings"
"time"
+ "code.gitea.io/gitea/modules/json"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
api "code.gitea.io/gitea/modules/structs"
"code.gitea.io/gitea/modules/timeutil"
gouuid "github.com/google/uuid"
- jsoniter "github.com/json-iterator/go"
)
// HookContentType is the content type of a web hook
@@ -160,8 +160,6 @@ type Webhook struct {
// AfterLoad updates the webhook object upon setting a column
func (w *Webhook) AfterLoad() {
w.HookEvent = &HookEvent{}
-
- json := jsoniter.ConfigCompatibleWithStandardLibrary
if err := json.Unmarshal([]byte(w.Events), w.HookEvent); err != nil {
log.Error("Unmarshal[%d]: %v", w.ID, err)
}
@@ -174,7 +172,6 @@ func (w *Webhook) History(page int) ([]*HookTask, error) {
// UpdateEvent handles conversion from HookEvent to Events.
func (w *Webhook) UpdateEvent() error {
- json := jsoniter.ConfigCompatibleWithStandardLibrary
data, err := json.Marshal(w.HookEvent)
w.Events = string(data)
return err
@@ -687,7 +684,6 @@ func (t *HookTask) AfterLoad() {
}
t.RequestInfo = &HookRequest{}
- json := jsoniter.ConfigCompatibleWithStandardLibrary
if err := json.Unmarshal([]byte(t.RequestContent), t.RequestInfo); err != nil {
log.Error("Unmarshal RequestContent[%d]: %v", t.ID, err)
}
@@ -701,7 +697,6 @@ func (t *HookTask) AfterLoad() {
}
func (t *HookTask) simpleMarshalJSON(v interface{}) string {
- json := jsoniter.ConfigCompatibleWithStandardLibrary
p, err := json.Marshal(v)
if err != nil {
log.Error("Marshal [%d]: %v", t.ID, err)