Skip to content

Commit 31c3313

Browse files
authored
Update default client Getters (#363)
* By default XTerrformGet header support should be disable; clients needing supporting this header should overwrite the default getters with a custom HttpGetter * Add default timeouts for HTTP Read Requests; including HEAD requests
1 parent 5ec880f commit 31c3313

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

get.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
"os/exec"
2020
"regexp"
2121
"syscall"
22+
"time"
2223

2324
cleanhttp "github.com/hashicorp/go-cleanhttp"
2425
)
@@ -70,7 +71,10 @@ var DefaultClient = &Client{
7071

7172
func init() {
7273
httpGetter := &HttpGetter{
73-
Netrc: true,
74+
Netrc: true,
75+
XTerraformGetDisabled: true,
76+
HeadFirstTimeout: 10 * time.Second,
77+
ReadTimeout: 30 * time.Second,
7478
}
7579

7680
// The order of the Getters in the list may affect the result

0 commit comments

Comments
 (0)