Skip to content

Commit 138c668

Browse files
committed
util, refactor: Use GetPathArg to read "-rpccookiefile" value
1 parent 1276090 commit 138c668

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/rpc/request.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,16 @@ UniValue JSONRPCError(int code, const std::string& message)
6666
*/
6767
static const std::string COOKIEAUTH_USER = "__cookie__";
6868
/** Default name for auth cookie file */
69-
static const std::string COOKIEAUTH_FILE = ".cookie";
69+
static const char* const COOKIEAUTH_FILE = ".cookie";
7070

7171
/** Get name of RPC authentication cookie file */
7272
static fs::path GetAuthCookieFile(bool temp=false)
7373
{
74-
std::string arg = gArgs.GetArg("-rpccookiefile", COOKIEAUTH_FILE);
74+
fs::path arg = gArgs.GetPathArg("-rpccookiefile", COOKIEAUTH_FILE);
7575
if (temp) {
7676
arg += ".tmp";
7777
}
78-
return AbsPathForConfigVal(fs::PathFromString(arg));
78+
return AbsPathForConfigVal(arg);
7979
}
8080

8181
bool GenerateAuthCookie(std::string *cookie_out)

0 commit comments

Comments
 (0)