From f45e959eff11acd8161fbdced546a56cbdb44034 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Sun, 27 Oct 2019 22:22:54 -0400 Subject: [PATCH] Normalize repo names for comparision Signed-off-by: Chris Smith --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 84721bc..adeb772 100644 --- a/main.go +++ b/main.go @@ -173,10 +173,10 @@ func processHook(c *gin.Context) { repoSplit := strings.Split(*payload.Repo.FullName, "/") checkSplit := strings.Split(repoOrOrgName, "/") - if repoSplit[0] != checkSplit[0] { + if strings.ToLower(repoSplit[0]) != strings.ToLower(checkSplit[0]) { c.JSON(http.StatusForbidden, gin.H{"message": "Not configured for this repository"}) return - } else if len(checkSplit) > 1 && repoSplit[1] != checkSplit[1] { + } else if len(checkSplit) > 1 && strings.ToLower(repoSplit[1]) != strings.ToLower(checkSplit[1]) { c.JSON(http.StatusForbidden, gin.H{"message": "Not configured for this repository"}) return }