From c8096b0fb72d7a5d9d3b500d961ea2120406d672 Mon Sep 17 00:00:00 2001 From: Asaf Gartner Date: Tue, 22 Mar 2022 20:34:42 +0200 Subject: [PATCH] Loosened expected status codes from twitch --- src/twitch/rest.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/twitch/rest.go b/src/twitch/rest.go index c697ac26..03960ba4 100644 --- a/src/twitch/rest.go +++ b/src/twitch/rest.go @@ -271,7 +271,7 @@ func subscribeToEvent(ctx context.Context, eventType string, twitchID string) er } defer readAndClose(res) - if res.StatusCode != 201 { + if res.StatusCode >= 300 { body, err := io.ReadAll(res.Body) res.Body.Close() if err != nil { @@ -296,7 +296,7 @@ func unsubscribeFromEvent(ctx context.Context, eventID string) error { } defer readAndClose(res) - if res.StatusCode != 204 { + if res.StatusCode > 300 { body, err := io.ReadAll(res.Body) res.Body.Close() if err != nil {