From 5360730d42e9bc685851d1d7cdf581dc72452370 Mon Sep 17 00:00:00 2001 From: crypto-facs <84574577+crypto-facs@users.noreply.github.com> Date: Tue, 15 Mar 2022 15:59:31 -0400 Subject: [PATCH] add enable unsafe cors flag (#995) --- server/flags/flags.go | 5 +++-- server/start.go | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/server/flags/flags.go b/server/flags/flags.go index 3774a196..11cf302e 100644 --- a/server/flags/flags.go +++ b/server/flags/flags.go @@ -24,9 +24,10 @@ const ( GRPCWebAddress = "grpc-web.address" ) -// RPCEnable Defines if Cosmos-sdk REST server should be enabled +// Cosmos API flags const ( - RPCEnable = "api.enable" + RPCEnable = "api.enable" + EnabledUnsafeCors = "api.enabled-unsafe-cors" ) // JSON-RPC flags diff --git a/server/start.go b/server/start.go index eacb3804..f0e15498 100644 --- a/server/start.go +++ b/server/start.go @@ -150,6 +150,7 @@ which accepts a path for the resulting pprof file. cmd.Flags().String(srvflags.GRPCWebAddress, serverconfig.DefaultGRPCWebAddress, "The gRPC-Web server address to listen on") cmd.Flags().Bool(srvflags.RPCEnable, false, "Defines if Cosmos-sdk REST server should be enabled") + cmd.Flags().Bool(srvflags.EnabledUnsafeCors, false, "Defines if CORS should be enabled (unsafe - use it at your own risk)") cmd.Flags().Bool(srvflags.JSONRPCEnable, true, "Define if the gRPC server should be enabled") cmd.Flags().StringSlice(srvflags.JSONRPCAPI, config.GetDefaultAPINamespaces(), "Defines a list of JSON-RPC namespaces that should be enabled")