From c30a9f87b3c6f35fb81b5e29ee551296c872937f Mon Sep 17 00:00:00 2001 From: Richard Lewis Date: Mon, 20 Feb 2017 18:11:42 +0000 Subject: [PATCH] Fix response code check --- src/github.com/matrix-org/go-neb/services/imgur/imgur.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/github.com/matrix-org/go-neb/services/imgur/imgur.go b/src/github.com/matrix-org/go-neb/services/imgur/imgur.go index 913718f..1da41d3 100644 --- a/src/github.com/matrix-org/go-neb/services/imgur/imgur.go +++ b/src/github.com/matrix-org/go-neb/services/imgur/imgur.go @@ -219,7 +219,7 @@ func (s *Service) text2imgImgur(query string) (*imgurGalleryImage, *imgurGallery if err != nil { return nil, nil, err } - if res.StatusCode > 200 { + if res.StatusCode < 200 || res.StatusCode >= 300 { return nil, nil, fmt.Errorf("Request error: %d, %s", res.StatusCode, response2String(res)) }