From a2598e649de8b41727084749527aa0bc27965856 Mon Sep 17 00:00:00 2001 From: Taylor Gerring Date: Mon, 18 May 2015 10:31:03 -0500 Subject: [PATCH] Permit multiple CORS domains Separated by spaces --- rpc/http.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rpc/http.go b/rpc/http.go index 9b3fa51426..f37e102f5d 100644 --- a/rpc/http.go +++ b/rpc/http.go @@ -6,6 +6,7 @@ import ( "io" "io/ioutil" "net/http" + "strings" "github.com/ethereum/go-ethereum/logger" "github.com/ethereum/go-ethereum/logger/glog" @@ -39,7 +40,7 @@ func Start(pipe *xeth.XEth, config RpcConfig) error { if len(config.CorsDomain) > 0 { var opts cors.Options opts.AllowedMethods = []string{"POST"} - opts.AllowedOrigins = []string{config.CorsDomain} + opts.AllowedOrigins = strings.Split(config.CorsDomain, " ") c := cors.New(opts) handler = newStoppableHandler(c.Handler(JSONRPC(pipe)), l.stop)