mirror of
https://gitlab.com/pulsechaincom/go-pulse.git
synced 2024-12-22 11:31:02 +00:00
Permit multiple CORS domains
Separated by spaces
This commit is contained in:
parent
677796b351
commit
a2598e649d
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user