Skip to content

There is something wrong with CORSAllowedOrigins #2980

@HaoyangLiu

Description

@HaoyangLiu

config.toml file

# A list of origins a cross-domain request can be executed from
# Default value '[]' disables cors support
# Use '["*"]' to allow any origin
cors_allowed_origins = "[]"

# A list of methods the client is allowed to use with cross-domain requests
cors_allowed_methods = "[HEAD GET POST]"

# A list of non simple headers the client is allowed to use with cross-domain requests
cors_allowed_headers = "[Origin Accept Content-Type X-Requested-With X-Server-Time]"

Load result:

*config = {*github.com/irisnet/irishub/vendor/github.com/tendermint/tendermint/config.Config} 
 BaseConfig = {github.com/irisnet/irishub/vendor/github.com/tendermint/tendermint/config.BaseConfig} 
 *RPC = {*github.com/irisnet/irishub/vendor/github.com/tendermint/tendermint/config.RPCConfig} 
  RootDir = "/home/lhy/temp/debug/iris-normal"
  ListenAddress = "tcp://0.0.0.0:26657"
  CORSAllowedOrigins = {[]string} len:2, cap:2
   0 = "91"
   1 = "93"
  CORSAllowedMethods = {[]string} len:15, cap:24
   0 = "91"
   1 = "72"
   2 = "69"
   3 = "65"
   4 = "68"
   5 = "32"
   6 = "71"
   7 = "69"
   8 = "84"
   9 = "32"
   10 = "80"
   11 = "79"
   12 = "83"
   13 = "84"
   14 = "93"
  CORSAllowedHeaders = {[]string} len:59, cap:80
  GRPCListenAddress = ""
  GRPCMaxOpenConnections = 900
  Unsafe = false
  MaxOpenConnections = 900

It seems that the string array is not well supported by toml serializer. @hleb-albau

Besides, if you repeat to execute tendermint init on the same home, these following sections will be very large.

CORSAllowedOrigins
CORSAllowedMethods
CORSAllowedHeaders

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions