Skip to content

Commit 9355186

Browse files
Empactfanquake
authored andcommitted
Replace use of boost::trim use with locale-independent TrimString
1 parent 77e77e8 commit 9355186

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/httprpc.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <rpc/protocol.h>
1111
#include <rpc/server.h>
1212
#include <util/strencodings.h>
13+
#include <util/string.h>
1314
#include <util/system.h>
1415
#include <util/translation.h>
1516
#include <walletinitinterface.h>
@@ -22,7 +23,7 @@
2223
#include <set>
2324
#include <string>
2425

25-
#include <boost/algorithm/string.hpp> // boost::trim
26+
#include <boost/algorithm/string.hpp>
2627

2728
/** WWW-Authenticate to present with 401 Unauthorized response */
2829
static const char* WWW_AUTH_HEADER_DATA = "Basic realm=\"jsonrpc\"";
@@ -130,8 +131,7 @@ static bool RPCAuthorized(const std::string& strAuth, std::string& strAuthUserna
130131
return false;
131132
if (strAuth.substr(0, 6) != "Basic ")
132133
return false;
133-
std::string strUserPass64 = strAuth.substr(6);
134-
boost::trim(strUserPass64);
134+
std::string strUserPass64 = TrimString(strAuth.substr(6));
135135
std::string strUserPass = DecodeBase64(strUserPass64);
136136

137137
if (strUserPass.find(':') != std::string::npos)

test/lint/lint-locale-dependence.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ KNOWN_VIOLATIONS=(
4242
"src/bitcoin-tx.cpp.*trim_right"
4343
"src/dbwrapper.cpp.*stoul"
4444
"src/dbwrapper.cpp:.*vsnprintf"
45-
"src/httprpc.cpp.*trim"
4645
"src/node/blockstorage.cpp:.*atoi"
4746
"src/qt/rpcconsole.cpp:.*atoi"
4847
"src/rest.cpp:.*strtol"

0 commit comments

Comments
 (0)