Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use proxy from environment #1885

Merged
merged 3 commits into from Nov 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions internal/client/gitea.go
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions internal/client/github.go
Expand Up @@ -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 != "" {
Expand Down
1 change: 1 addition & 0 deletions internal/client/gitlab.go
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions internal/http/http.go
Expand Up @@ -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,
},
Expand Down