Add error checking for the jws httpPost (#360)
https://github.com/xenolf/lego/issues/359
This commit is contained in:
parent
e526fb5a1a
commit
0e2937900b
1 changed files with 4 additions and 1 deletions
|
@ -41,7 +41,10 @@ func (j *jws) post(url string, content []byte) (*http.Response, error) {
|
|||
}
|
||||
|
||||
resp, err := httpPost(url, "application/jose+json", bytes.NewBuffer([]byte(signedContent.FullSerialize())))
|
||||
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Failed to HTTP POST to %s -> %s", url, err.Error())
|
||||
}
|
||||
|
||||
// Even in case of an error, the response should still contain a nonce.
|
||||
nonce, nonceErr := getNonceFromResponse(resp)
|
||||
if nonceErr == nil {
|
||||
|
|
Loading…
Reference in a new issue