mirror of
https://github.com/go-acme/lego.git
synced 2024-12-27 03:32:05 +02:00
Merge pull request #99 from jehiah/http_head_error_99
Handle HEAD request errors
This commit is contained in:
commit
1198444908
@ -33,9 +33,10 @@ func httpHead(url string) (resp *http.Response, err error) {
|
||||
req.Header.Set("User-Agent", userAgent())
|
||||
|
||||
resp, err = http.DefaultClient.Do(req)
|
||||
if resp.Body != nil {
|
||||
resp.Body.Close()
|
||||
if err != nil {
|
||||
return resp, err
|
||||
}
|
||||
resp.Body.Close()
|
||||
return resp, err
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user