mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-25 08:21:07 -06:00
a127607a85
Signed-off-by: Dmitry Kisler <admin@dkisler.com>
23 lines
522 B
Go
23 lines
522 B
Go
// Copyright (c) HashiCorp, Inc.
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
package httpclient
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
cleanhttp "github.com/hashicorp/go-cleanhttp"
|
|
"github.com/opentofu/opentofu/version"
|
|
)
|
|
|
|
// New returns the DefaultPooledClient from the cleanhttp
|
|
// package that will also send a OpenTofu User-Agent string.
|
|
func New() *http.Client {
|
|
cli := cleanhttp.DefaultPooledClient()
|
|
cli.Transport = &userAgentRoundTripper{
|
|
userAgent: OpenTofuUserAgent(version.Version),
|
|
inner: cli.Transport,
|
|
}
|
|
return cli
|
|
}
|