Skip to content

Commit 5dc713b

Browse files
committed
[REST] set REST API behind "-rest" option
1 parent 78bdc81 commit 5dc713b

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/init.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,7 @@ std::string HelpMessage(HelpMessageMode mode)
352352

353353
strUsage += "\n" + _("RPC server options:") + "\n";
354354
strUsage += " -server " + _("Accept command line and JSON-RPC commands") + "\n";
355+
strUsage += " -rest " + strprintf(_("Accept public REST requests (default: %u)"), 0) + "\n";
355356
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";
356357
strUsage += " -rpcuser=<user> " + _("Username for JSON-RPC connections") + "\n";
357358
strUsage += " -rpcpassword=<pw> " + _("Password for JSON-RPC connections") + "\n";

src/rpcserver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,7 @@ void ServiceConnection(AcceptedConnection *conn)
955955
break;
956956

957957
// Process via HTTP REST API
958-
} else if (strURI.substr(0, 6) == "/rest/") {
958+
} else if (strURI.substr(0, 6) == "/rest/" && GetBoolArg("-rest", false)) {
959959
if (!HTTPReq_REST(conn, strURI, mapHeaders, fRun))
960960
break;
961961

0 commit comments

Comments
 (0)