Skip to content

Commit

Permalink
event/target/webhook: treat all 2xx as success. (minio#5792)
Browse files Browse the repository at this point in the history
  • Loading branch information
balamurugana authored and kannappanr committed Apr 11, 2018
1 parent 57a3d9c commit 650c6ee
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pkg/event/target/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 650c6ee

Please sign in to comment.