@@ -500,6 +500,16 @@ func MakeNAT(ctx *cli.Context) nat.Interface {
500
500
return natif
501
501
}
502
502
503
+ // MakeRPCModules splits input separated by a comma and trims excessive white
504
+ // space from the substrings.
505
+ func MakeRPCModules (input string ) []string {
506
+ result := strings .Split (input , "," )
507
+ for i , r := range result {
508
+ result [i ] = strings .TrimSpace (r )
509
+ }
510
+ return result
511
+ }
512
+
503
513
// MakeHTTPRpcHost creates the HTTP RPC listener interface string from the set
504
514
// command line flags, returning empty if the HTTP endpoint is disabled.
505
515
func MakeHTTPRpcHost (ctx * cli.Context ) string {
@@ -652,11 +662,11 @@ func MakeSystemNode(name, version string, extra []byte, ctx *cli.Context) *node.
652
662
HTTPHost : MakeHTTPRpcHost (ctx ),
653
663
HTTPPort : ctx .GlobalInt (RPCPortFlag .Name ),
654
664
HTTPCors : ctx .GlobalString (RPCCORSDomainFlag .Name ),
655
- HTTPModules : strings . Split (ctx .GlobalString (RPCApiFlag .Name ), "," ),
665
+ HTTPModules : MakeRPCModules (ctx .GlobalString (RPCApiFlag .Name )),
656
666
WSHost : MakeWSRpcHost (ctx ),
657
667
WSPort : ctx .GlobalInt (WSPortFlag .Name ),
658
668
WSOrigins : ctx .GlobalString (WSAllowedOriginsFlag .Name ),
659
- WSModules : strings . Split (ctx .GlobalString (WSApiFlag .Name ), "," ),
669
+ WSModules : MakeRPCModules (ctx .GlobalString (WSApiFlag .Name )),
660
670
}
661
671
// Configure the Ethereum service
662
672
accman := MakeAccountManager (ctx )
0 commit comments