opentofu/internal/httpclient/client.go
Dmitry Kisler a127607a85
Rename terraform to tofu in GoString method and docstrings (#576)
Signed-off-by: Dmitry Kisler <admin@dkisler.com>
2023-09-26 19:09:27 +02:00

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
}