mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-09 03:02:40 +02:00
Replace use of boost::trim use with locale-independent TrimString
This commit is contained in:
@@ -10,6 +10,7 @@
|
|||||||
#include <rpc/protocol.h>
|
#include <rpc/protocol.h>
|
||||||
#include <rpc/server.h>
|
#include <rpc/server.h>
|
||||||
#include <util/strencodings.h>
|
#include <util/strencodings.h>
|
||||||
|
#include <util/string.h>
|
||||||
#include <util/system.h>
|
#include <util/system.h>
|
||||||
#include <util/translation.h>
|
#include <util/translation.h>
|
||||||
#include <walletinitinterface.h>
|
#include <walletinitinterface.h>
|
||||||
@@ -22,7 +23,7 @@
|
|||||||
#include <set>
|
#include <set>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include <boost/algorithm/string.hpp> // boost::trim
|
#include <boost/algorithm/string.hpp>
|
||||||
|
|
||||||
/** WWW-Authenticate to present with 401 Unauthorized response */
|
/** WWW-Authenticate to present with 401 Unauthorized response */
|
||||||
static const char* WWW_AUTH_HEADER_DATA = "Basic realm=\"jsonrpc\"";
|
static const char* WWW_AUTH_HEADER_DATA = "Basic realm=\"jsonrpc\"";
|
||||||
@@ -130,8 +131,7 @@ static bool RPCAuthorized(const std::string& strAuth, std::string& strAuthUserna
|
|||||||
return false;
|
return false;
|
||||||
if (strAuth.substr(0, 6) != "Basic ")
|
if (strAuth.substr(0, 6) != "Basic ")
|
||||||
return false;
|
return false;
|
||||||
std::string strUserPass64 = strAuth.substr(6);
|
std::string strUserPass64 = TrimString(strAuth.substr(6));
|
||||||
boost::trim(strUserPass64);
|
|
||||||
std::string strUserPass = DecodeBase64(strUserPass64);
|
std::string strUserPass = DecodeBase64(strUserPass64);
|
||||||
|
|
||||||
if (strUserPass.find(':') != std::string::npos)
|
if (strUserPass.find(':') != std::string::npos)
|
||||||
|
@@ -42,7 +42,6 @@ KNOWN_VIOLATIONS=(
|
|||||||
"src/bitcoin-tx.cpp.*trim_right"
|
"src/bitcoin-tx.cpp.*trim_right"
|
||||||
"src/dbwrapper.cpp.*stoul"
|
"src/dbwrapper.cpp.*stoul"
|
||||||
"src/dbwrapper.cpp:.*vsnprintf"
|
"src/dbwrapper.cpp:.*vsnprintf"
|
||||||
"src/httprpc.cpp.*trim"
|
|
||||||
"src/node/blockstorage.cpp:.*atoi"
|
"src/node/blockstorage.cpp:.*atoi"
|
||||||
"src/qt/rpcconsole.cpp:.*atoi"
|
"src/qt/rpcconsole.cpp:.*atoi"
|
||||||
"src/rest.cpp:.*strtol"
|
"src/rest.cpp:.*strtol"
|
||||||
|
Reference in New Issue
Block a user