forked from TrueCloudLab/lego
Add HTTPTimeout variable to http.go.
This lets users of this library override the default internal timeout for HTTP requests issued by the library. The default is 10 seconds.
This commit is contained in:
parent
1389afd8d8
commit
9e0c21c439
1 changed files with 4 additions and 1 deletions
|
@ -14,8 +14,11 @@ import (
|
||||||
// UserAgent (if non-empty) will be tacked onto the User-Agent string in requests.
|
// UserAgent (if non-empty) will be tacked onto the User-Agent string in requests.
|
||||||
var UserAgent string
|
var UserAgent string
|
||||||
|
|
||||||
|
// HTTPTimeout is used to override the default HTTP timeout of 10 seconds.
|
||||||
|
var HTTPTimeout = 10 * time.Second
|
||||||
|
|
||||||
// defaultClient is an HTTP client with a reasonable timeout value.
|
// defaultClient is an HTTP client with a reasonable timeout value.
|
||||||
var defaultClient = http.Client{Timeout: 10 * time.Second}
|
var defaultClient = http.Client{Timeout: HTTPTimeout}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// defaultGoUserAgent is the Go HTTP package user agent string. Too
|
// defaultGoUserAgent is the Go HTTP package user agent string. Too
|
||||||
|
|
Loading…
Reference in a new issue