aboutsummaryrefslogtreecommitdiffstats
path: root/routers/repo/webhook.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/repo/webhook.go')
-rw-r--r--routers/repo/webhook.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/routers/repo/webhook.go b/routers/repo/webhook.go
index 49aec8184b..0c3fd1267d 100644
--- a/routers/repo/webhook.go
+++ b/routers/repo/webhook.go
@@ -20,9 +20,8 @@ import (
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/setting"
api "code.gitea.io/gitea/modules/structs"
+ "code.gitea.io/gitea/modules/util"
"code.gitea.io/gitea/services/webhook"
-
- "github.com/unknwon/com"
)
const (
@@ -100,7 +99,7 @@ func getOrgRepoCtx(ctx *context.Context) (*orgRepoCtx, error) {
func checkHookType(ctx *context.Context) string {
hookType := strings.ToLower(ctx.Params(":type"))
- if !com.IsSliceContainsStr(setting.Webhook.Types, hookType) {
+ if !util.IsStringInSlice(hookType, setting.Webhook.Types, true) {
ctx.NotFound("checkHookType", nil)
return ""
}