mirror of
https://github.com/go-acme/lego.git
synced 2025-01-14 10:55:05 +02:00
fix: read status code from response (#1937)
This commit is contained in:
parent
c81ccf042e
commit
32b083e537
@ -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}
|
||||
|
Loading…
Reference in New Issue
Block a user