From 88628038333621735b63da951bdfeb865f33067e Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Mon, 10 Dec 2018 12:14:07 +0400 Subject: [PATCH] config: cors options are arrays of strings, not strings Fixes #2980 --- CHANGELOG_PENDING.md | 3 ++- config/config.go | 2 +- config/toml.go | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index 74d81bd5f..d0a7a6474 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -21,4 +21,5 @@ Special thanks to external contributors on this release: ### IMPROVEMENTS: ### BUG FIXES: -- [kv indexer] \#2912 don't ignore key when executing CONTAINS \ No newline at end of file +- [kv indexer] \#2912 don't ignore key when executing CONTAINS +- [config] \#2980 fix cors options formatting diff --git a/config/config.go b/config/config.go index 23b033994..abcc24ebd 100644 --- a/config/config.go +++ b/config/config.go @@ -779,7 +779,7 @@ type InstrumentationConfig struct { // 0 - unlimited. MaxOpenConnections int `mapstructure:"max_open_connections"` - // Tendermint instrumentation namespace. + // Instrumentation namespace. Namespace string `mapstructure:"namespace"` } diff --git a/config/toml.go b/config/toml.go index 21e017b45..3157fd425 100644 --- a/config/toml.go +++ b/config/toml.go @@ -125,13 +125,13 @@ laddr = "{{ .RPC.ListenAddress }}" # 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 = "{{ .RPC.CORSAllowedOrigins }}" +cors_allowed_origins = [{{ range .RPC.CORSAllowedOrigins }}{{ printf "%q, " . }}{{end}}] # A list of methods the client is allowed to use with cross-domain requests -cors_allowed_methods = "{{ .RPC.CORSAllowedMethods }}" +cors_allowed_methods = [{{ range .RPC.CORSAllowedMethods }}{{ printf "%q, " . }}{{end}}] # A list of non simple headers the client is allowed to use with cross-domain requests -cors_allowed_headers = "{{ .RPC.CORSAllowedHeaders }}" +cors_allowed_headers = [{{ range .RPC.CORSAllowedHeaders }}{{ printf "%q, " . }}{{end}}] # TCP or UNIX socket address for the gRPC server to listen on # NOTE: This server only supports /broadcast_tx_commit