Skip to content

Commit

Permalink
added per-hook defined response message
Browse files Browse the repository at this point in the history
  • Loading branch information
adnanh committed Mar 17, 2015
1 parent 5a96a57 commit f83af97
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions hook/hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ type Hook struct {
ID string `json:"id"`
ExecuteCommand string `json:"execute-command"`
CommandWorkingDirectory string `json:"command-working-directory"`
ResponseMessage string `json:"response-message"`
PassArgumentsToCommand []Argument `json:"pass-arguments-to-command"`
TriggerRule *Rules `json:"trigger-rule"`
}
Expand Down
7 changes: 4 additions & 3 deletions webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
)

const (
version = "2.2.1"
version = "2.2.2"
)

var (
Expand Down Expand Up @@ -175,9 +175,10 @@ func hookHandler(w http.ResponseWriter, r *http.Request) {
// handle hook
go handleHook(hook, &headers, &query, &payload, &body)

// say thanks
fmt.Fprintf(w, "Thanks.")
// send the hook defined response message
fmt.Fprintf(w, hook.ResponseMessage)
} else {
w.WriteHeader(http.StatusNotFound)
fmt.Fprintf(w, "Hook not found.")
}
}
Expand Down

0 comments on commit f83af97

Please sign in to comment.