Browse Source

[REST] set REST API behind "-rest" option

0.10
Jonas Schnelli 10 years ago
parent
commit
5dc713bfc7
  1. 1
      src/init.cpp
  2. 2
      src/rpcserver.cpp

1
src/init.cpp

@ -352,6 +352,7 @@ std::string HelpMessage(HelpMessageMode mode) @@ -352,6 +352,7 @@ std::string HelpMessage(HelpMessageMode mode)
strUsage += "\n" + _("RPC server options:") + "\n";
strUsage += " -server " + _("Accept command line and JSON-RPC commands") + "\n";
strUsage += " -rest " + strprintf(_("Accept public REST requests (default: %u)"), 0) + "\n";
strUsage += " -rpcbind=<addr> " + _("Bind to given address to listen for JSON-RPC connections. Use [host]:port notation for IPv6. This option can be specified multiple times (default: bind to all interfaces)") + "\n";
strUsage += " -rpcuser=<user> " + _("Username for JSON-RPC connections") + "\n";
strUsage += " -rpcpassword=<pw> " + _("Password for JSON-RPC connections") + "\n";

2
src/rpcserver.cpp

@ -955,7 +955,7 @@ void ServiceConnection(AcceptedConnection *conn) @@ -955,7 +955,7 @@ void ServiceConnection(AcceptedConnection *conn)
break;
// Process via HTTP REST API
} else if (strURI.substr(0, 6) == "/rest/") {
} else if (strURI.substr(0, 6) == "/rest/" && GetBoolArg("-rest", false)) {
if (!HTTPReq_REST(conn, strURI, mapHeaders, fRun))
break;

Loading…
Cancel
Save