From 473747d8effa73cf742d77b34b7af0a2c7e5763e Mon Sep 17 00:00:00 2001 From: andig Date: Sun, 4 May 2025 12:39:21 +0200 Subject: [PATCH] Http: mark non-success status errors as permanent --- util/request/functions.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/util/request/functions.go b/util/request/functions.go index e6583e094..fe8882c78 100644 --- a/util/request/functions.go +++ b/util/request/functions.go @@ -4,6 +4,8 @@ import ( "fmt" "io" "net/http" + + "github.com/cenkalti/backoff/v4" ) var ( @@ -89,7 +91,7 @@ func ReadBody(resp *http.Response) ([]byte, error) { } if resp.StatusCode < 200 || resp.StatusCode >= 300 { - return b, &StatusError{resp: resp} + return b, backoff.Permanent(&StatusError{resp: resp}) } return b, nil