@@ -225,7 +225,7 @@ func (u *URL) UnmarshalJSON(data []byte) error {
225225// MarshalJSON implements the json.Marshaler interface for URL.
226226func (u URL ) MarshalJSON () ([]byte , error ) {
227227 if u .URL != nil {
228- return json .Marshal (u .URL . String ())
228+ return json .Marshal (u .String ())
229229 }
230230 return []byte ("null" ), nil
231231}
@@ -251,7 +251,7 @@ func (o *OAuth2) UnmarshalYAML(unmarshal func(interface{}) error) error {
251251 if err := unmarshal ((* plain )(o )); err != nil {
252252 return err
253253 }
254- return o .ProxyConfig . Validate ()
254+ return o .Validate ()
255255}
256256
257257// UnmarshalJSON implements the json.Marshaler interface for URL.
@@ -260,7 +260,7 @@ func (o *OAuth2) UnmarshalJSON(data []byte) error {
260260 if err := json .Unmarshal (data , (* plain )(o )); err != nil {
261261 return err
262262 }
263- return o .ProxyConfig . Validate ()
263+ return o .Validate ()
264264}
265265
266266// SetDirectory joins any relative file paths with dir.
@@ -604,8 +604,8 @@ func NewRoundTripperFromConfigWithContext(ctx context.Context, cfg HTTPClientCon
604604 // The only timeout we care about is the configured scrape timeout.
605605 // It is applied on request. So we leave out any timings here.
606606 var rt http.RoundTripper = & http.Transport {
607- Proxy : cfg .ProxyConfig . Proxy (),
608- ProxyConnectHeader : cfg .ProxyConfig . GetProxyConnectHeader (),
607+ Proxy : cfg .Proxy (),
608+ ProxyConnectHeader : cfg .GetProxyConnectHeader (),
609609 MaxIdleConns : 20000 ,
610610 MaxIdleConnsPerHost : 1000 , // see https://github.com/golang/go/issues/13801
611611 DisableKeepAlives : ! opts .keepAlivesEnabled ,
@@ -914,8 +914,8 @@ func (rt *oauth2RoundTripper) newOauth2TokenSource(req *http.Request, secret str
914914 tlsTransport := func (tlsConfig * tls.Config ) (http.RoundTripper , error ) {
915915 return & http.Transport {
916916 TLSClientConfig : tlsConfig ,
917- Proxy : rt .config .ProxyConfig . Proxy (),
918- ProxyConnectHeader : rt .config .ProxyConfig . GetProxyConnectHeader (),
917+ Proxy : rt .config .Proxy (),
918+ ProxyConnectHeader : rt .config .GetProxyConnectHeader (),
919919 DisableKeepAlives : ! rt .opts .keepAlivesEnabled ,
920920 MaxIdleConns : 20 ,
921921 MaxIdleConnsPerHost : 1 , // see https://github.com/golang/go/issues/13801
@@ -1508,7 +1508,7 @@ func (c *ProxyConfig) Proxy() (fn func(*http.Request) (*url.URL, error)) {
15081508 }
15091509 return
15101510 }
1511- if c .ProxyURL .URL != nil && c .ProxyURL .URL . String () != "" {
1511+ if c .ProxyURL .URL != nil && c .ProxyURL .String () != "" {
15121512 if c .NoProxy == "" {
15131513 c .proxyFunc = http .ProxyURL (c .ProxyURL .URL )
15141514 return
0 commit comments