Skip to content

Commit

Permalink
notifier: ensure Content-Type header present in webhook notification
Browse files Browse the repository at this point in the history
Signed-off-by: Alec Merdler <alecmerdler@gmail.com>
  • Loading branch information
alecmerdler committed Oct 8, 2020
1 parent a2d5f9b commit 0c1554e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions notifier/webhook/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,11 @@ func (c *Config) Validate() (Config, error) {
return conf, fmt.Errorf("failed to parse callback url")
}
conf.callback = callback

if conf.Headers == nil {
conf.Headers = map[string][]string{}
}
conf.Headers.Set("Content-Type", "application/json")

return conf, nil
}

0 comments on commit 0c1554e

Please sign in to comment.