Skip to content

Commit

Permalink
Added SuccessHttpResponseCode handling for case when capture output i…
Browse files Browse the repository at this point in the history
…s set to true.
  • Loading branch information
aioobe committed Sep 15, 2018
1 parent 22073d8 commit ef3f43f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit ef3f43f

Please sign in to comment.