mirror of
https://github.com/adnanh/webhook.git
synced 2026-07-26 17:00:45 +08:00
added per-hook defined response message
This commit is contained in:
+4
-3
@@ -22,7 +22,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
version = "2.2.1"
|
||||
version = "2.2.2"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -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.")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user