aboutsummaryrefslogtreecommitdiffstats
path: root/rpc
diff options
context:
space:
mode:
authorTaylor Gerring <taylor.gerring@gmail.com>2015-05-18 23:31:03 +0800
committerTaylor Gerring <taylor.gerring@gmail.com>2015-05-18 23:31:03 +0800
commita2598e649de8b41727084749527aa0bc27965856 (patch)
tree2b0ec26182a473e3eccc07b1fd8ee131bf617505 /rpc
parent677796b3517782dd530b7a1a7d9dfd16b643404c (diff)
downloadgo-tangerine-a2598e649de8b41727084749527aa0bc27965856.tar
go-tangerine-a2598e649de8b41727084749527aa0bc27965856.tar.gz
go-tangerine-a2598e649de8b41727084749527aa0bc27965856.tar.bz2
go-tangerine-a2598e649de8b41727084749527aa0bc27965856.tar.lz
go-tangerine-a2598e649de8b41727084749527aa0bc27965856.tar.xz
go-tangerine-a2598e649de8b41727084749527aa0bc27965856.tar.zst
go-tangerine-a2598e649de8b41727084749527aa0bc27965856.zip
Permit multiple CORS domains
Separated by spaces
Diffstat (limited to 'rpc')
-rw-r--r--rpc/http.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/rpc/http.go b/rpc/http.go
index 9b3fa5142..f37e102f5 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)