mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-02-05 13:15:26 +02:00
feat: use proxy from environment (#1885)
* feat: use proxy from environment Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * Update internal/client/github.go Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
parent
032a105533
commit
f1049b94ef
@ -40,6 +40,7 @@ func NewGitea(ctx *context.Context, token string) (Client, error) {
|
||||
return nil, err
|
||||
}
|
||||
transport := &http.Transport{
|
||||
Proxy: http.ProxyFromEnvironment,
|
||||
TLSClientConfig: &tls.Config{
|
||||
// nolint: gosec
|
||||
InsecureSkipVerify: ctx.Config.GiteaURLs.SkipTLSVerify,
|
||||
|
@ -38,6 +38,7 @@ func NewGitHub(ctx *context.Context, token string) (Client, error) {
|
||||
base.(*http.Transport).TLSClientConfig = &tls.Config{
|
||||
InsecureSkipVerify: ctx.Config.GitHubURLs.SkipTLSVerify,
|
||||
}
|
||||
base.(*http.Transport).Proxy = http.ProxyFromEnvironment
|
||||
httpClient.Transport.(*oauth2.Transport).Base = base
|
||||
client := github.NewClient(httpClient)
|
||||
if ctx.Config.GitHubURLs.API != "" {
|
||||
|
@ -28,6 +28,7 @@ type gitlabClient struct {
|
||||
// NewGitLab returns a gitlab client implementation.
|
||||
func NewGitLab(ctx *context.Context, token string) (Client, error) {
|
||||
transport := &http.Transport{
|
||||
Proxy: http.ProxyFromEnvironment,
|
||||
TLSClientConfig: &tls.Config{
|
||||
// nolint: gosec
|
||||
InsecureSkipVerify: ctx.Config.GitLabURLs.SkipTLSVerify,
|
||||
|
@ -311,6 +311,7 @@ func getHTTPClient(upload *config.Upload) (*h.Client, error) {
|
||||
pool.AppendCertsFromPEM([]byte(upload.TrustedCerts)) // already validated certs checked by CheckConfig
|
||||
return &h.Client{
|
||||
Transport: &h.Transport{
|
||||
Proxy: h.ProxyFromEnvironment,
|
||||
TLSClientConfig: &tls.Config{ // nolint: gosec
|
||||
RootCAs: pool,
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user