File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,11 @@ import (
3333 "gopkg.in/yaml.v2"
3434)
3535
36+ // DefaultHTTPClientConfig is the default HTTP client configuration.
37+ var DefaultHTTPClientConfig = HTTPClientConfig {
38+ FollowRedirects : true ,
39+ }
40+
3641type closeIdler interface {
3742 CloseIdleConnections ()
3843}
@@ -111,7 +116,7 @@ type HTTPClientConfig struct {
111116 ProxyURL URL `yaml:"proxy_url,omitempty"`
112117 // TLSConfig to use to connect to the targets.
113118 TLSConfig TLSConfig `yaml:"tls_config,omitempty"`
114- // FollowRedirects specifies wheter the client should follow the HTTP 3xx redirects.
119+ // FollowRedirects specifies wheter the client should follow HTTP 3xx redirects.
115120 // The omitempty flag is not set, because it would be hidden from the
116121 // marshalled configuration when set to false.
117122 FollowRedirects bool `yaml:"follow_redirects"`
@@ -176,9 +181,7 @@ func (c *HTTPClientConfig) Validate() error {
176181// UnmarshalYAML implements the yaml.Unmarshaler interface
177182func (c * HTTPClientConfig ) UnmarshalYAML (unmarshal func (interface {}) error ) error {
178183 type plain HTTPClientConfig
179- * c = HTTPClientConfig {
180- FollowRedirects : true ,
181- }
184+ * c = DefaultHTTPClientConfig
182185 if err := unmarshal ((* plain )(c )); err != nil {
183186 return err
184187 }
You can’t perform that action at this time.
0 commit comments