Skip to content

Commit

Permalink
Allow empty network.proxy setting (#830)
Browse files Browse the repository at this point in the history
This workaround must be here until viper can UnSet properties:
spf13/viper#519
  • Loading branch information
cmaglie committed Jul 14, 2020
1 parent e7638c7 commit 72c9655
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion httpclient/httpclient_config.go
Expand Up @@ -37,7 +37,11 @@ func DefaultConfig() (*Config, error) {
var err error
if viper.IsSet("network.proxy") {
proxyConfig := viper.GetString("network.proxy")
if proxy, err = url.Parse(proxyConfig); err != nil {
if proxyConfig == "" {
// empty configuration
// this workaround must be here until viper can UnSet properties:
// https://github.com/spf13/viper/pull/519
} else if proxy, err = url.Parse(proxyConfig); err != nil {
return nil, errors.New("Invalid network.proxy '" + proxyConfig + "': " + err.Error())
}
}
Expand Down

0 comments on commit 72c9655

Please sign in to comment.