summaryrefslogtreecommitdiffstats
path: root/services/webhook/webhook.go
diff options
context:
space:
mode:
Diffstat (limited to 'services/webhook/webhook.go')
-rw-r--r--services/webhook/webhook.go7
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
}