added support for incoming-payload-content-type

This commit is contained in:
Donald Clark Jackson 2017-11-27 14:02:57 -08:00
parent a49364ae93
commit f84edae99d
2 changed files with 5 additions and 0 deletions

View file

@ -228,7 +228,11 @@ func hookHandler(w http.ResponseWriter, r *http.Request) {
// parse body
var payload map[string]interface{}
// set contentType to IncomingPayloadContentType or header value
contentType := r.Header.Get("Content-Type")
if len(matchedHook.IncomingPayloadContentType) != 0 {
contentType = matchedHook.IncomingPayloadContentType
}
if strings.Contains(contentType, "json") {
decoder := json.NewDecoder(strings.NewReader(string(body)))