mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-06 08:16:19 +02:00
ensure client uses ProxyFromEnvironment
This commit is contained in:
parent
88df2520c8
commit
d05aad8b48
@ -76,7 +76,10 @@ func NewClientTokenTLS(uri, token string, c *tls.Config) Client {
|
|||||||
auther := config.Client(oauth2.NoContext, &oauth2.Token{AccessToken: token})
|
auther := config.Client(oauth2.NoContext, &oauth2.Token{AccessToken: token})
|
||||||
if c != nil {
|
if c != nil {
|
||||||
if trans, ok := auther.Transport.(*oauth2.Transport); ok {
|
if trans, ok := auther.Transport.(*oauth2.Transport); ok {
|
||||||
trans.Base = &http.Transport{TLSClientConfig: c}
|
trans.Base = &http.Transport{
|
||||||
|
TLSClientConfig: c,
|
||||||
|
Proxy: http.ProxyFromEnvironment,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return &client{client: auther, base: uri, token: token}
|
return &client{client: auther, base: uri, token: token}
|
||||||
|
Loading…
Reference in New Issue
Block a user