move custom http client creation with env proxy args into same package as other network related helpers

This commit is contained in:
Megan Marsh 2020-11-04 14:50:34 -08:00
parent 7b57e28600
commit 45b5f0c2ee
3 changed files with 5 additions and 5 deletions

View File

@ -5,7 +5,7 @@ import (
"fmt"
"net/http"
commonhelper "github.com/hashicorp/packer/helper/common"
"github.com/hashicorp/packer/common/net"
"github.com/hashicorp/packer/helper/multistep"
"github.com/hashicorp/packer/packer"
)
@ -29,7 +29,7 @@ func (s *stepSetISO) Run(ctx context.Context, state multistep.StateBag) multiste
req.Header.Set("User-Agent", "Packer")
httpClient := commonhelper.HttpClientWithEnvironmentProxy()
httpClient := net.HttpClientWithEnvironmentProxy()
res, err := httpClient.Do(req)
if err == nil && (res.StatusCode >= 200 && res.StatusCode < 300) {

View File

@ -1,4 +1,4 @@
package common
package net
import (
"net/http"

View File

@ -11,7 +11,7 @@ import (
"os"
"strings"
commonhelper "github.com/hashicorp/packer/helper/common"
"github.com/hashicorp/packer/common/net"
)
type VagrantCloudClient struct {
@ -48,7 +48,7 @@ func (v VagrantCloudErrors) FormatErrors() string {
func (v VagrantCloudClient) New(baseUrl string, token string, InsecureSkipTLSVerify bool) (*VagrantCloudClient, error) {
c := &VagrantCloudClient{
client: commonhelper.HttpClientWithEnvironmentProxy(),
client: net.HttpClientWithEnvironmentProxy(),
BaseURL: baseUrl,
AccessToken: token,
}