Skip to content

Commit

Permalink
add test cors headers
Browse files Browse the repository at this point in the history
  • Loading branch information
rinor committed Jun 2, 2020
1 parent 4068404 commit 4fe32ec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/vitconfig/vitconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ func main() {
block0cfg.BlockchainConfiguration.Block0Consensus = consensus
block0cfg.BlockchainConfiguration.Discrimination = block0Discrimination

block0cfg.BlockchainConfiguration.SlotDuration = 4
block0cfg.BlockchainConfiguration.SlotsPerEpoch = 21600
block0cfg.BlockchainConfiguration.SlotDuration = 2
block0cfg.BlockchainConfiguration.SlotsPerEpoch = 43200

block0cfg.BlockchainConfiguration.LinearFees.Certificate = 5
block0cfg.BlockchainConfiguration.LinearFees.Coefficient = 3
Expand Down Expand Up @@ -364,6 +364,7 @@ func main() {
nodeCfg.P2P.ListenAddress = p2pListenAddress
nodeCfg.P2P.AllowPrivateAddresses = true
nodeCfg.Log.Level = nodeCfgLogLevel
// nodeCfg.Rest.Cors.AllowedOrigins = []string{"*"}

nodeCfgYaml, err := nodeCfg.ToYaml()
kit.FatalOn(err)
Expand Down
2 changes: 2 additions & 0 deletions internal/webproxy/webproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ func (h *V0Handler) ServeHTTP(res http.ResponseWriter, req *http.Request) {
var head string
head, req.URL.Path = ShiftPath(req.URL.Path)

res.Header().Set("Access-Control-Allow-Origin", "*")

switch head {
case "proposals":
h.ProposalHandler.ServeHTTP(res, req)
Expand Down

0 comments on commit 4fe32ec

Please # to comment.