forked from TrueCloudLab/lego
fix: read status code from response (#1937)
This commit is contained in:
parent
c81ccf042e
commit
32b083e537
1 changed files with 4 additions and 0 deletions
|
@ -133,6 +133,10 @@ func checkError(req *http.Request, resp *http.Response) error {
|
||||||
errorDetails.Method = req.Method
|
errorDetails.Method = req.Method
|
||||||
errorDetails.URL = req.URL.String()
|
errorDetails.URL = req.URL.String()
|
||||||
|
|
||||||
|
if errorDetails.HTTPStatus == 0 {
|
||||||
|
errorDetails.HTTPStatus = resp.StatusCode
|
||||||
|
}
|
||||||
|
|
||||||
// Check for errors we handle specifically
|
// Check for errors we handle specifically
|
||||||
if errorDetails.HTTPStatus == http.StatusBadRequest && errorDetails.Type == acme.BadNonceErr {
|
if errorDetails.HTTPStatus == http.StatusBadRequest && errorDetails.Type == acme.BadNonceErr {
|
||||||
return &acme.NonceError{ProblemDetails: errorDetails}
|
return &acme.NonceError{ProblemDetails: errorDetails}
|
||||||
|
|
Loading…
Reference in a new issue