add enable unsafe cors flag (#995)

This commit is contained in:
crypto-facs 2022-03-15 15:59:31 -04:00 committed by GitHub
parent 49afc0f90d
commit 5360730d42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -24,9 +24,10 @@ const (
GRPCWebAddress = "grpc-web.address" GRPCWebAddress = "grpc-web.address"
) )
// RPCEnable Defines if Cosmos-sdk REST server should be enabled // Cosmos API flags
const ( const (
RPCEnable = "api.enable" RPCEnable = "api.enable"
EnabledUnsafeCors = "api.enabled-unsafe-cors"
) )
// JSON-RPC flags // JSON-RPC flags

View File

@ -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().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.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().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") cmd.Flags().StringSlice(srvflags.JSONRPCAPI, config.GetDefaultAPINamespaces(), "Defines a list of JSON-RPC namespaces that should be enabled")