Skip to content

Commit

Permalink
correct the return status to check for created 201 (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
g8rswimmer authored Jan 23, 2021
1 parent 916f262 commit c70a4a2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tweet.go
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ func (t *Tweet) ApplyFilteredStreamRules(ctx context.Context, rules TweetSearchS

decoder := json.NewDecoder(resp.Body)

if resp.StatusCode != http.StatusOK {
if resp.StatusCode != http.StatusCreated {
e := &TweetErrorResponse{}
if err := decoder.Decode(e); err != nil {
return nil, &HTTPError{
Expand Down
4 changes: 2 additions & 2 deletions tweet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ func TestTweet_UpdateSearchStreamRules(t *testing.T) {
}
}`
return &http.Response{
StatusCode: http.StatusOK,
StatusCode: http.StatusCreated,
Body: ioutil.NopCloser(strings.NewReader(body)),
}
}),
Expand Down Expand Up @@ -668,7 +668,7 @@ func TestTweet_UpdateSearchStreamRules(t *testing.T) {
}
}`
return &http.Response{
StatusCode: http.StatusOK,
StatusCode: http.StatusCreated,
Body: ioutil.NopCloser(strings.NewReader(body)),
}
}),
Expand Down

0 comments on commit c70a4a2

Please sign in to comment.