utils,node: fix defaults for rpcvhosts

This commit is contained in:
Martin Holst Swende 2018-03-04 09:01:17 +01:00
parent 031cdeb129
commit 6a078b51f6
2 changed files with 1 additions and 2 deletions

View file

@ -697,8 +697,6 @@ func setHTTP(ctx *cli.Context, cfg *node.Config) {
} }
if ctx.GlobalIsSet(RPCVirtualHostsFlag.Name) { if ctx.GlobalIsSet(RPCVirtualHostsFlag.Name) {
cfg.HTTPVirtualHosts = splitAndTrim(ctx.GlobalString(RPCVirtualHostsFlag.Name)) cfg.HTTPVirtualHosts = splitAndTrim(ctx.GlobalString(RPCVirtualHostsFlag.Name))
} else if len(cfg.HTTPVirtualHosts) == 0 {
cfg.HTTPVirtualHosts = splitAndTrim(ctx.GlobalString(RPCVirtualHostsFlag.Name))
} }
} }

View file

@ -45,6 +45,7 @@ var DefaultConfig = Config{
MaxPeers: 25, MaxPeers: 25,
NAT: nat.Any(), NAT: nat.Any(),
}, },
HTTPVirtualHosts: []string{"localhost"},
} }
// DefaultDataDir is the default data directory to use for the databases and other // DefaultDataDir is the default data directory to use for the databases and other