Skip to content

Commit 6a6f97b

Browse files
committed
fix rebase
1 parent b54f2b9 commit 6a6f97b

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

internal/api/api.go

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,19 @@ func buildTransport(opts ClientOpts, flags *Flags) http.RoundTripper {
100100
{
101101
tp := http.DefaultTransport.(*http.Transport).Clone()
102102

103-
if flags.insecureSkipVerify != nil && *flags.insecureSkipVerify {
104-
transport.TLSClientConfig = &tls.Config{InsecureSkipVerify: true}
105-
}
103+
if flags.insecureSkipVerify != nil && *flags.insecureSkipVerify {
104+
tp.TLSClientConfig = &tls.Config{InsecureSkipVerify: true}
105+
}
106106

107-
// not we do not fail here if requireAccessToken is true, because that would
108-
// mean returning an error on construction which we want to avoid for now
109-
// TODO(burmudar): allow returning of an error upon client construction
110-
if opts.AccessToken == "" && opts.OAuthToken != nil {
111-
transport = oauth.NewTransport(transport, opts.OAuthToken)
107+
if tp.TLSClientConfig == nil {
108+
tp.TLSClientConfig = &tls.Config{}
109+
}
110+
111+
if opts.ProxyURL != nil || opts.ProxyPath != "" {
112+
tp = withProxyTransport(tp, opts.ProxyURL, opts.ProxyPath)
113+
}
114+
115+
transport = tp
112116
}
113117

114118
// not we do not fail here if requireAccessToken is true, because that would

0 commit comments

Comments
 (0)