Give the user the choice to parse SystemHooks

This commit is contained in:
Martin Treml
2019-03-11 08:13:22 +01:00
parent 66059be93b
commit bad16bfcd0
2 changed files with 1 additions and 4 deletions
-3
View File
@@ -89,9 +89,6 @@ func (hook Webhook) Parse(r *http.Request, events ...Event) (interface{}, error)
return nil, ErrInvalidHTTPMethod
}
// Add SystemHookEvents to event slice to allow parsing
events = append(events, SystemHookEvents)
// If we have a Secret set, we should check the MAC
if len(hook.secret) > 0 {
signature := r.Header.Get("X-Gitlab-Token")
+1 -1
View File
@@ -306,7 +306,7 @@ func TestSystemHooks(t *testing.T) {
var parseError error
var results interface{}
server := newServer(func(w http.ResponseWriter, r *http.Request) {
results, parseError = hook.Parse(r, tc.event)
results, parseError = hook.Parse(r, SystemHookEvents, tc.event)
})
defer server.Close()
req, err := http.NewRequest(http.MethodPost, server.URL+path, payload)