event/target/webhook: treat all 2xx as success. (#5792)

Fixes #5769
This commit is contained in:
Bala FA 2018-04-11 06:15:54 +05:30 committed by kannappanr
parent 57a3d9c16c
commit 650c6ee8fb
1 changed files with 3 additions and 4 deletions

View File

@ -79,12 +79,11 @@ func (target *WebhookTarget) Send(eventData event.Event) error {
// FIXME: log returned error. ignore time being.
_ = resp.Body.Close()
switch resp.StatusCode {
case http.StatusOK, http.StatusAccepted, http.StatusContinue:
return nil
default:
if resp.StatusCode < 200 || resp.StatusCode > 299 {
return fmt.Errorf("sending event failed with %v", resp.Status)
}
return nil
}
// Close - does nothing and available for interface compatibility.