Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Allow empty network.proxy settings
This workaround must be here until viper can UnSet properties:
spf13/viper#519
  • Loading branch information
cmaglie committed Jul 14, 2020
commit 876aa88995d707e876f60d8d3d00d95b8ada4d85
6 changes: 5 additions & 1 deletion httpclient/httpclient_config.go
Original file line number Diff line number Diff line change
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