From 5e2097f15c97f49d574538cdeea8a215619599281cb692895d52b97fca0d2b07 Mon Sep 17 00:00:00 2001 From: Adam Majer Date: Tue, 10 Sep 2024 17:33:34 +0200 Subject: [PATCH] missing returns in error conditions --- gitea-events-rabbitmq-publisher/main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gitea-events-rabbitmq-publisher/main.go b/gitea-events-rabbitmq-publisher/main.go index edbc365..dfcd4e3 100644 --- a/gitea-events-rabbitmq-publisher/main.go +++ b/gitea-events-rabbitmq-publisher/main.go @@ -344,6 +344,7 @@ func main() { if DebugMode { log.Printf(errorStr) } + return } if !json.Valid(data) { @@ -351,6 +352,7 @@ func main() { log.Println("send invalid json request") } res.WriteHeader(http.StatusBadRequest) + return } org, extraAction, err := parseRequestJSONOrg(reqType, data) @@ -382,6 +384,7 @@ func main() { if DebugMode { log.Println(errorStr) } + return } res.WriteHeader(http.StatusOK) })