aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorMartin Holst Swende <martin@swende.se>2018-03-05 19:02:32 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-03-05 19:02:32 +0800
commit478143d69a13103a6809ef41a64b25db8c2438ee (patch)
tree456ea29d86563aa7265ca8f96b3b389e92115b7e /cmd
parentabed63c38fe817e73ccbc8f123aee044d10d1711 (diff)
downloaddexon-478143d69a13103a6809ef41a64b25db8c2438ee.tar
dexon-478143d69a13103a6809ef41a64b25db8c2438ee.tar.gz
dexon-478143d69a13103a6809ef41a64b25db8c2438ee.tar.bz2
dexon-478143d69a13103a6809ef41a64b25db8c2438ee.tar.lz
dexon-478143d69a13103a6809ef41a64b25db8c2438ee.tar.xz
dexon-478143d69a13103a6809ef41a64b25db8c2438ee.tar.zst
dexon-478143d69a13103a6809ef41a64b25db8c2438ee.zip
utils: fix #16138 by checking if vhosts flag is set (#16141)
* utils: fix #16138 by checking if vhosts flag is set * utils,node: fix defaults for rpcvhosts * node,utils: address review concerns
Diffstat (limited to 'cmd')
-rw-r--r--cmd/utils/flags.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go
index 5fd5013f0..dbf26b8e0 100644
--- a/cmd/utils/flags.go
+++ b/cmd/utils/flags.go
@@ -400,7 +400,7 @@ var (
RPCVirtualHostsFlag = cli.StringFlag{
Name: "rpcvhosts",
Usage: "Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard.",
- Value: "localhost",
+ Value: strings.Join(node.DefaultConfig.HTTPVirtualHosts, ","),
}
RPCApiFlag = cli.StringFlag{
Name: "rpcapi",
@@ -695,8 +695,9 @@ func setHTTP(ctx *cli.Context, cfg *node.Config) {
if ctx.GlobalIsSet(RPCApiFlag.Name) {
cfg.HTTPModules = splitAndTrim(ctx.GlobalString(RPCApiFlag.Name))
}
-
- cfg.HTTPVirtualHosts = splitAndTrim(ctx.GlobalString(RPCVirtualHostsFlag.Name))
+ if ctx.GlobalIsSet(RPCVirtualHostsFlag.Name) {
+ cfg.HTTPVirtualHosts = splitAndTrim(ctx.GlobalString(RPCVirtualHostsFlag.Name))
+ }
}
// setWS creates the WebSocket RPC listener interface string from the set