Merge pull request #31164 from hashicorp/jbardin/go-getter-security-options

add XTerraformGetLimit to prevent redirect loops
This commit is contained in:
James Bardin 2022-06-01 13:04:20 -04:00 committed by GitHub
commit 4fb8a5a3ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -96,6 +96,7 @@ func (c *ProvidersMirrorCommand) Run(args []string) int {
httpGetter := getter.HttpGetter{
Client: httpclient.New(),
Netrc: true,
XTerraformGetDisabled: true,
}
// The following logic is similar to that used by the provider installer

View File

@ -85,6 +85,7 @@ var getterHTTPClient = cleanhttp.DefaultClient()
var getterHTTPGetter = &getter.HttpGetter{
Client: getterHTTPClient,
Netrc: true,
XTerraformGetLimit: 10,
}
// A reusingGetter is a helper for the module installer that remembers