Skip to content

Commit 72c9655

Browse files
authored
Allow empty network.proxy setting (#830)
This workaround must be here until viper can UnSet properties: spf13/viper#519
1 parent e7638c7 commit 72c9655

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

httpclient/httpclient_config.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ func DefaultConfig() (*Config, error) {
3737
var err error
3838
if viper.IsSet("network.proxy") {
3939
proxyConfig := viper.GetString("network.proxy")
40-
if proxy, err = url.Parse(proxyConfig); err != nil {
40+
if proxyConfig == "" {
41+
// empty configuration
42+
// this workaround must be here until viper can UnSet properties:
43+
// https://github.com/spf13/viper/pull/519
44+
} else if proxy, err = url.Parse(proxyConfig); err != nil {
4145
return nil, errors.New("Invalid network.proxy '" + proxyConfig + "': " + err.Error())
4246
}
4347
}

0 commit comments

Comments
 (0)