summaryrefslogtreecommitdiffstats
path: root/models/webhook.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/webhook.go')
-rw-r--r--models/webhook.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/models/webhook.go b/models/webhook.go
index 7a28e37958..e3e11e5963 100644
--- a/models/webhook.go
+++ b/models/webhook.go
@@ -700,7 +700,10 @@ func prepareWebhook(e Engine, w *Webhook, repo *Repository, event HookEventType,
log.Error("prepareWebhooks.JSONPayload: %v", err)
}
sig := hmac.New(sha256.New, []byte(w.Secret))
- sig.Write(data)
+ _, err = sig.Write(data)
+ if err != nil {
+ log.Error("prepareWebhooks.sigWrite: %v", err)
+ }
signature = hex.EncodeToString(sig.Sum(nil))
}
@@ -930,8 +933,7 @@ func InitDeliverHooks() {
return nil, err
}
- conn.SetDeadline(time.Now().Add(timeout))
- return conn, nil
+ return conn, conn.SetDeadline(time.Now().Add(timeout))
},
},