Skip to content

Commit

Permalink
webhook: add JSON envelope
Browse files Browse the repository at this point in the history
  • Loading branch information
jzelinskie committed Feb 24, 2016
1 parent a193651 commit 8c282fd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion notifier/notifiers/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,15 @@ func (h *WebhookNotifier) Configure(config *config.NotifierConfig) (bool, error)
return true, nil
}

type notificationEnvelope struct {
Notification struct {
Name string
}
}

func (h *WebhookNotifier) Send(notification database.VulnerabilityNotification) error {
// Marshal notification.
jsonNotification, err := json.Marshal(notification.Name)
jsonNotification, err := json.Marshal(notificationEnvelope{struct{ Name string }{notification.Name}})
if err != nil {
return fmt.Errorf("could not marshal: %s", err)
}
Expand Down

0 comments on commit 8c282fd

Please sign in to comment.