From 4758efe7da8dbdb332c6794fd9533670a00a397b Mon Sep 17 00:00:00 2001 From: Maartje Eyskens Date: Tue, 17 Nov 2020 16:03:58 +0100 Subject: [PATCH] Apply suggestions from code review Signed-off-by: Maartje Eyskens Co-authored-by: Richard Wall --- pkg/acme/util/util.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/acme/util/util.go b/pkg/acme/util/util.go index 9373c932a..c51c47ba7 100644 --- a/pkg/acme/util/util.go +++ b/pkg/acme/util/util.go @@ -29,12 +29,13 @@ func RetryBackoff(n int, r *http.Request, resp *http.Response) time.Duration { // According to the spec badNonce is urn:ietf:params:acme:error:badNonce. // However, we can not use the request body in here as it is closed already. - // So we're using it's status code instead: 400 + // So we're using its status code instead: 400 if resp.StatusCode == http.StatusBadRequest { // don't retry more than 6 times, if we get 6 nonce mismatches something is quite wrong if n > 5 { return -1 - } else if n < 1 { + } + if n < 1 { // n is used for the backoff time below n = 1 }