mirror of
https://github.com/adnanh/webhook.git
synced 2025-05-11 16:14:52 +00:00
removed leftover debug trace, fixed a panic bug
This commit is contained in:
parent
baec1cadc5
commit
231426da57
2 changed files with 6 additions and 4 deletions
|
@ -105,8 +105,12 @@ func GetParameter(s string, params interface{}) (interface{}, bool) {
|
|||
}
|
||||
|
||||
if p := strings.SplitN(s, ".", 2); len(p) > 1 {
|
||||
if pValue, ok := params.(map[string]interface{})[p[0]]; ok {
|
||||
return GetParameter(p[1], pValue)
|
||||
if paramsValue := reflect.ValueOf(params); paramsValue.Kind() == reflect.Map {
|
||||
if pValue, ok := params.(map[string]interface{})[p[0]]; ok {
|
||||
return GetParameter(p[1], pValue)
|
||||
}
|
||||
} else {
|
||||
return nil, false
|
||||
}
|
||||
} else {
|
||||
if pValue, ok := params.(map[string]interface{})[p[0]]; ok {
|
||||
|
|
|
@ -172,8 +172,6 @@ func hookHandler(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
hook.ParseJSONParameters(&headers, &query, &payload)
|
||||
|
||||
fmt.Printf("%+v", payload)
|
||||
|
||||
// handle hook
|
||||
go handleHook(hook, &headers, &query, &payload, &body)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue