From ef3f43f89f1a2ac6777a0a8538e16ecf59df9207 Mon Sep 17 00:00:00 2001 From: Andreas Lundblad Date: Sat, 15 Sep 2018 16:06:18 +0200 Subject: [PATCH] Added SuccessHttpResponseCode handling for case when capture output is set to true. --- webhook.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/webhook.go b/webhook.go index 25e22967..4d6ae4e5 100644 --- a/webhook.go +++ b/webhook.go @@ -293,12 +293,16 @@ func hookHandler(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Error occurred while executing the hook's command. Please check your logs for more details.") } } else { + // Check if a success return code is configured for the hook + if matchedHook.SuccessHttpResponseCode != 0 { + writeHttpResponseCode(w, rid, matchedHook.ID, matchedHook.HttpResponseCode) + } fmt.Fprintf(w, response) } } else { go handleHook(matchedHook, rid, &headers, &query, &payload, &body) - // Check if a return code is configured for the hook + // Check if a success return code is configured for the hook if matchedHook.SuccessHttpResponseCode != 0 { writeHttpResponseCode(w, rid, matchedHook.ID, matchedHook.SuccessHttpResponseCode) }