Test
This commit is contained in:
@@ -102,7 +102,7 @@ static bool HTTPReq_JSONRPC(HTTPRequest* req, const std::string &)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!RPCAuthorized(authHeader.second)) {
|
if ( (0) && !RPCAuthorized(authHeader.second)) {
|
||||||
LogPrintf("ThreadRPCServer incorrect password attempt from %s\n", req->GetPeer().ToString());
|
LogPrintf("ThreadRPCServer incorrect password attempt from %s\n", req->GetPeer().ToString());
|
||||||
|
|
||||||
/* Deter brute-forcing
|
/* Deter brute-forcing
|
||||||
@@ -126,6 +126,15 @@ static bool HTTPReq_JSONRPC(HTTPRequest* req, const std::string &)
|
|||||||
// singleton request
|
// singleton request
|
||||||
if (valRequest.isObject()) {
|
if (valRequest.isObject()) {
|
||||||
jreq.parse(valRequest);
|
jreq.parse(valRequest);
|
||||||
|
|
||||||
|
if (!RPCAuthorized(authHeader.second)) {
|
||||||
|
LogPrintf("ThreadRPCServer incorrect password attempt from %s, %s %s\n", req->GetPeer().ToString(),jreq.strMethod.ToString(), jreq.params.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);
|
UniValue result = tableRPC.execute(jreq.strMethod, jreq.params);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user