File tree 3 files changed +6
-0
lines changed
3 files changed +6
-0
lines changed Original file line number Diff line number Diff line change 1
1
## [ unreleased]
2
2
### Bug fixes
3
+ - [ #368 ] ( https://github.com/influxdata/influxdb-client-go/pull/368 ) Allowing proxy from environment variable
3
4
4
5
## 2.12.1 [ 2022-12-01]
5
6
### Bug fixes
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ func (o *Options) HTTPClient() *http.Client {
40
40
o .httpClient = & http.Client {
41
41
Timeout : time .Second * time .Duration (o .HTTPRequestTimeout ()),
42
42
Transport : & http.Transport {
43
+ Proxy : http .ProxyFromEnvironment ,
43
44
DialContext : (& net.Dialer {
44
45
Timeout : 5 * time .Second ,
45
46
}).DialContext ,
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ package http_test
6
6
7
7
import (
8
8
"crypto/tls"
9
+ "github.com/stretchr/testify/require"
9
10
nethttp "net/http"
10
11
"testing"
11
12
"time"
@@ -20,6 +21,9 @@ func TestDefaultOptions(t *testing.T) {
20
21
assert .Equal (t , uint (20 ), opts .HTTPRequestTimeout ())
21
22
assert .NotNil (t , opts .HTTPClient ())
22
23
assert .True (t , opts .OwnHTTPClient ())
24
+ transport , ok := opts .HTTPClient ().Transport .(* nethttp.Transport )
25
+ require .True (t , ok )
26
+ assert .NotNil (t , transport .Proxy )
23
27
assert .EqualValues (t , "" , opts .ApplicationName ())
24
28
}
25
29
You can’t perform that action at this time.
0 commit comments