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 (
400400 RPCVirtualHostsFlag = cli.StringFlag {
401401 Name : "rpcvhosts" ,
402402 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 , "," ) ,
404404 }
405405 RPCApiFlag = cli.StringFlag {
406406 Name : "rpcapi" ,
@@ -695,8 +695,9 @@ func setHTTP(ctx *cli.Context, cfg *node.Config) {
695695 if ctx .GlobalIsSet (RPCApiFlag .Name ) {
696696 cfg .HTTPModules = splitAndTrim (ctx .GlobalString (RPCApiFlag .Name ))
697697 }
698-
699- cfg .HTTPVirtualHosts = splitAndTrim (ctx .GlobalString (RPCVirtualHostsFlag .Name ))
698+ if ctx .GlobalIsSet (RPCVirtualHostsFlag .Name ) {
699+ cfg .HTTPVirtualHosts = splitAndTrim (ctx .GlobalString (RPCVirtualHostsFlag .Name ))
700+ }
700701}
701702
702703// 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 (
3535
3636// DefaultConfig contains reasonable default settings.
3737var 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" },
4344 P2P : p2p.Config {
4445 ListenAddr : ":30303" ,
4546 MaxPeers : 25 ,
You can’t perform that action at this time.
0 commit comments