diff options
Diffstat (limited to 'services')
-rw-r--r-- | services/webhook/webhook.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/services/webhook/webhook.go b/services/webhook/webhook.go index b779b38466..7b6bc555f7 100644 --- a/services/webhook/webhook.go +++ b/services/webhook/webhook.go @@ -60,7 +60,7 @@ var ( // RegisterWebhook registers a webhook func RegisterWebhook(name string, webhook *webhook) { - webhooks[models.HookTaskType(strings.TrimSpace(name))] = webhook + webhooks[models.HookTaskType(name)] = webhook } // IsValidHookTaskType returns true if a webhook registered @@ -68,7 +68,7 @@ func IsValidHookTaskType(name string) bool { if name == models.GITEA || name == models.GOGS { return true } - _, ok := webhooks[models.HookTaskType(strings.TrimSpace(name))] + _, ok := webhooks[models.HookTaskType(name)] return ok } @@ -147,7 +147,7 @@ func prepareWebhook(w *models.Webhook, repo *models.Repository, event models.Hoo var payloader api.Payloader var err error - webhook, ok := webhooks[strings.TrimSpace(w.Type)] // NOTICE: w.Type maynot be trimmed before store into database + webhook, ok := webhooks[w.Type] if ok { payloader, err = webhook.payloadCreator(p, event, w.Meta) if err != nil { |