Skip to content
This repository has been archived by the owner on Aug 31, 2022. It is now read-only.

Commit

Permalink
Merge pull request #50 from njegosrailic/webhook_status_code
Browse files Browse the repository at this point in the history
Handle HTTP Status code 201 in the webhook sink
  • Loading branch information
mustafaakin-atl authored Jun 22, 2020
2 parents d6b6842 + 80f904e commit b0edf7c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/sinks/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ func (w *Webhook) Send(ctx context.Context, ev *kube.EnhancedEvent) error {
body, err := ioutil.ReadAll(resp.Body)

// TODO: make this prettier please
if resp.StatusCode != http.StatusOK {
return errors.New("not 200: " + string(body))
if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusCreated {
return errors.New("not 200/201: " + string(body))
}

return nil
Expand Down

0 comments on commit b0edf7c

Please sign in to comment.