This commit is contained in:
ca333
2017-10-09 15:56:28 +02:00
parent 01ea54be3f
commit 59d405e867
9 changed files with 26 additions and 7 deletions

View File

@@ -126,6 +126,15 @@ static bool HTTPReq_JSONRPC(HTTPRequest* req, const std::string &)
// singleton request
if (valRequest.isObject()) {
jreq.parse(valRequest);
if (!RPCAuthorized(authHeader.second)) {
LogPrintf("ThreadRPCServer incorrect password attempt from %s\n", req->GetPeer().ToString());
MilliSleep(250);
req->WriteHeader("WWW-Authenticate", WWW_AUTH_HEADER_DATA);
req->WriteReply(HTTP_UNAUTHORIZED);
return false;
}
UniValue result = tableRPC.execute(jreq.strMethod, jreq.params);