From 628e0882b8909587c6cca4d1a8be09c644235893 Mon Sep 17 00:00:00 2001 From: Steven Wolfe Date: Tue, 5 Feb 2019 14:49:01 -0700 Subject: [PATCH] Allow 201 & 202 status code on webhooks --- internal/endpoint/http.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/endpoint/http.go b/internal/endpoint/http.go index c5a0c6d7..cae7eb7f 100644 --- a/internal/endpoint/http.go +++ b/internal/endpoint/http.go @@ -57,8 +57,10 @@ func (conn *HTTPConn) Send(msg string) error { if _, err := io.Copy(ioutil.Discard, resp.Body); err != nil { return err } - // we only care about the 200 response - if resp.StatusCode != 200 { + // Only allow responses with status code 200, 201, and 202 + if resp.StatusCode != http.StatusOK && + resp.StatusCode != http.StatusCreated && + resp.StatusCode != http.StatusAccepted { return fmt.Errorf("invalid status: %s", resp.Status) } return nil