removed leftover debug trace, fixed a panic bug

This commit is contained in:
Adnan Hajdarevic 2015-03-21 01:26:04 +01:00
parent baec1cadc5
commit 231426da57
2 changed files with 6 additions and 4 deletions

View file

@ -105,9 +105,13 @@ func GetParameter(s string, params interface{}) (interface{}, bool) {
} }
if p := strings.SplitN(s, ".", 2); len(p) > 1 { if p := strings.SplitN(s, ".", 2); len(p) > 1 {
if paramsValue := reflect.ValueOf(params); paramsValue.Kind() == reflect.Map {
if pValue, ok := params.(map[string]interface{})[p[0]]; ok { if pValue, ok := params.(map[string]interface{})[p[0]]; ok {
return GetParameter(p[1], pValue) return GetParameter(p[1], pValue)
} }
} else {
return nil, false
}
} else { } else {
if pValue, ok := params.(map[string]interface{})[p[0]]; ok { if pValue, ok := params.(map[string]interface{})[p[0]]; ok {
return pValue, true return pValue, true

View file

@ -172,8 +172,6 @@ func hookHandler(w http.ResponseWriter, r *http.Request) {
hook.ParseJSONParameters(&headers, &query, &payload) hook.ParseJSONParameters(&headers, &query, &payload)
fmt.Printf("%+v", payload)
// handle hook // handle hook
go handleHook(hook, &headers, &query, &payload, &body) go handleHook(hook, &headers, &query, &payload, &body)