Skip to content

Commit

Permalink
Add flag to control CORS header ethereum#394
Browse files Browse the repository at this point in the history
* Disabled on CLI
* http://localhost on Mist
  • Loading branch information
tgerring committed Mar 29, 2015
1 parent e1c6c01 commit 24fc1f0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions cmd/geth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ JavaScript API. See https://github.com/ethereum/go-ethereum/wiki/Javascipt-Conso
utils.VMDebugFlag,
utils.ProtocolVersionFlag,
utils.NetworkIdFlag,
utils.RPCCORSDomainFlag,
}

// missing:
Expand Down
7 changes: 7 additions & 0 deletions cmd/mist/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,19 @@ var (
Usage: "absolute path to GUI assets directory",
Value: common.DefaultAssetPath(),
}
rpcCorsFlag = utils.RPCCORSDomainFlag
)

func init() {
// Mist-specific default
if len(rpcCorsFlag.Value) == 0 {
rpcCorsFlag.Value = "http://localhost"
}

app.Action = run
app.Flags = []cli.Flag{
assetPathFlag,
rpcCorsFlag,

utils.BootnodesFlag,
utils.DataDirFlag,
Expand Down
6 changes: 5 additions & 1 deletion cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,11 @@ var (
Usage: "Port on which the JSON-RPC server should listen",
Value: 8545,
}

RPCCORSDomainFlag = cli.StringFlag{
Name: "rpccorsdomain",
Usage: "Domain on which to send Access-Control-Allow-Origin header",
Value: "",
}
// Network Settings
MaxPeersFlag = cli.IntFlag{
Name: "maxpeers",
Expand Down

0 comments on commit 24fc1f0

Please sign in to comment.