From 47f9850f02331c0aead68941cfc1974663edbdc2 Mon Sep 17 00:00:00 2001 From: James Bardin Date: Tue, 31 May 2022 15:19:12 -0400 Subject: [PATCH] add XTerraformGetLimit to prevent redirect loops --- internal/command/providers_mirror.go | 5 +++-- internal/getmodules/getter.go | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/internal/command/providers_mirror.go b/internal/command/providers_mirror.go index e816a114fb42..5890ed8d995c 100644 --- a/internal/command/providers_mirror.go +++ b/internal/command/providers_mirror.go @@ -94,8 +94,9 @@ func (c *ProvidersMirrorCommand) Run(args []string) int { // generality of go-getter but it's still handy to use the HTTP getter // as an easy way to download over HTTP into a file on disk. httpGetter := getter.HttpGetter{ - Client: httpclient.New(), - Netrc: true, + Client: httpclient.New(), + Netrc: true, + XTerraformGetDisabled: true, } // The following logic is similar to that used by the provider installer diff --git a/internal/getmodules/getter.go b/internal/getmodules/getter.go index 95f334762e64..82ea599afcb9 100644 --- a/internal/getmodules/getter.go +++ b/internal/getmodules/getter.go @@ -83,8 +83,9 @@ var goGetterGetters = map[string]getter.Getter{ var getterHTTPClient = cleanhttp.DefaultClient() var getterHTTPGetter = &getter.HttpGetter{ - Client: getterHTTPClient, - Netrc: true, + Client: getterHTTPClient, + Netrc: true, + XTerraformGetLimit: 10, } // A reusingGetter is a helper for the module installer that remembers