From f7d1f09b5c4626f3053181fed4003fdb697bc030 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Fri, 24 Dec 2021 22:14:24 +0100 Subject: [PATCH] [core] Fix: Do not retry any request with body Signed-off-by: Knut Ahlers --- twitch/twitch.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/twitch/twitch.go b/twitch/twitch.go index e7f9334..59b86a9 100644 --- a/twitch/twitch.go +++ b/twitch/twitch.go @@ -16,7 +16,6 @@ import ( log "github.com/sirupsen/logrus" "github.com/Luzifer/go_helpers/v2/backoff" - "github.com/Luzifer/go_helpers/v2/str" ) const ( @@ -604,9 +603,8 @@ func (c *Client) request(opts clientRequestOpts) error { }).Trace("Execute Twitch API request") var retries uint64 = twitchRequestRetries - if str.StringInSlice(opts.Method, []string{ - http.MethodPost, // Creates stuff, must not be retried without being asked - }) { + if opts.Body != nil { + // Body must be read only once, do not retry retries = 1 }