File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -400,7 +400,7 @@ var (
400
400
RPCVirtualHostsFlag = cli.StringFlag {
401
401
Name : "rpcvhosts" ,
402
402
Usage : "Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard." ,
403
- Value : "localhost" ,
403
+ Value : strings . Join ( node . DefaultConfig . HTTPVirtualHosts , "," ) ,
404
404
}
405
405
RPCApiFlag = cli.StringFlag {
406
406
Name : "rpcapi" ,
@@ -695,8 +695,9 @@ func setHTTP(ctx *cli.Context, cfg *node.Config) {
695
695
if ctx .GlobalIsSet (RPCApiFlag .Name ) {
696
696
cfg .HTTPModules = splitAndTrim (ctx .GlobalString (RPCApiFlag .Name ))
697
697
}
698
-
699
- cfg .HTTPVirtualHosts = splitAndTrim (ctx .GlobalString (RPCVirtualHostsFlag .Name ))
698
+ if ctx .GlobalIsSet (RPCVirtualHostsFlag .Name ) {
699
+ cfg .HTTPVirtualHosts = splitAndTrim (ctx .GlobalString (RPCVirtualHostsFlag .Name ))
700
+ }
700
701
}
701
702
702
703
// setWS creates the WebSocket RPC listener interface string from the set
Original file line number Diff line number Diff line change @@ -35,11 +35,12 @@ const (
35
35
36
36
// DefaultConfig contains reasonable default settings.
37
37
var DefaultConfig = Config {
38
- DataDir : DefaultDataDir (),
39
- HTTPPort : DefaultHTTPPort ,
40
- HTTPModules : []string {"net" , "web3" },
41
- WSPort : DefaultWSPort ,
42
- WSModules : []string {"net" , "web3" },
38
+ DataDir : DefaultDataDir (),
39
+ HTTPPort : DefaultHTTPPort ,
40
+ HTTPModules : []string {"net" , "web3" },
41
+ HTTPVirtualHosts : []string {"localhost" },
42
+ WSPort : DefaultWSPort ,
43
+ WSModules : []string {"net" , "web3" },
43
44
P2P : p2p.Config {
44
45
ListenAddr : ":30303" ,
45
46
MaxPeers : 25 ,
You can’t perform that action at this time.
0 commit comments