diff options
Diffstat (limited to 'services/webhook/webhook.go')
-rw-r--r-- | services/webhook/webhook.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/services/webhook/webhook.go b/services/webhook/webhook.go index a86d638ab5..b779b38466 100644 --- a/services/webhook/webhook.go +++ b/services/webhook/webhook.go @@ -60,12 +60,15 @@ var ( // RegisterWebhook registers a webhook func RegisterWebhook(name string, webhook *webhook) { - webhooks[models.HookTaskType(name)] = webhook + webhooks[models.HookTaskType(strings.TrimSpace(name))] = webhook } // IsValidHookTaskType returns true if a webhook registered func IsValidHookTaskType(name string) bool { - _, ok := webhooks[models.HookTaskType(name)] + if name == models.GITEA || name == models.GOGS { + return true + } + _, ok := webhooks[models.HookTaskType(strings.TrimSpace(name))] return ok } |