From 32b083e5370cb48e2353aa22de4f6d8290fbb505 Mon Sep 17 00:00:00 2001 From: gsato-godaddy <93266532+gsato-godaddy@users.noreply.github.com> Date: Mon, 19 Jun 2023 08:02:21 -0700 Subject: [PATCH] fix: read status code from response (#1937) --- acme/api/internal/sender/sender.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/acme/api/internal/sender/sender.go b/acme/api/internal/sender/sender.go index 9b5c5041..29cd7c9b 100644 --- a/acme/api/internal/sender/sender.go +++ b/acme/api/internal/sender/sender.go @@ -133,6 +133,10 @@ func checkError(req *http.Request, resp *http.Response) error { errorDetails.Method = req.Method errorDetails.URL = req.URL.String() + if errorDetails.HTTPStatus == 0 { + errorDetails.HTTPStatus = resp.StatusCode + } + // Check for errors we handle specifically if errorDetails.HTTPStatus == http.StatusBadRequest && errorDetails.Type == acme.BadNonceErr { return &acme.NonceError{ProblemDetails: errorDetails}