Skip to content

Commit

Permalink
make url paths as variables
Browse files Browse the repository at this point in the history
  • Loading branch information
reddink committed Mar 22, 2022
1 parent b42e393 commit 3c16cfe
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/rpc/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ static Mutex g_deadline_timers_mutex;
static std::map<std::string, std::unique_ptr<RPCTimerBase> > deadlineTimers GUARDED_BY(g_deadline_timers_mutex);
static bool ExecuteCommand(const CRPCCommand& command, const JSONRPCRequest& request, UniValue& result, bool last_handler);

static std::string strDownloadLink = "https://download.reddcoin.com/bin/reddcoin-core-";
static std::string strGithubLink = "/repos/reddcoin-project/reddcoin-0.22/releases/latest";

struct RPCCommandExecutionInfo
{
std::string method;
Expand Down Expand Up @@ -308,7 +311,7 @@ void checkforupdatesinfo(UniValue& result) {
// Send request
boost::asio::streambuf request;
std::ostream request_stream(&request);
request_stream << "GET /repos/reddcoin-project/reddcoin-0.22/releases/latest HTTP/1.1\r\n"; // note that you can change it if you wish to HTTP/1.0
request_stream << "GET " << strGithubLink << " HTTP/1.1\r\n"; // note that you can change it if you wish to HTTP/1.0
request_stream << "Host: api.github.com\r\n";
request_stream << "User-Agent: C/1.0\r\n";
request_stream << "Content-Type: application/json; charset=utf-8\r\n";
Expand Down Expand Up @@ -392,7 +395,7 @@ void checkforupdatesinfo(UniValue& result) {
// Build direct download link
std::string urlWalletVersion = latestRepoVersion;
boost::replace_all(urlWalletVersion, "v", "");
officialDownloadLink = "https://download.reddcoin.com/bin/reddcoin-core-" + urlWalletVersion;
officialDownloadLink = strDownloadLink + urlWalletVersion;

std::string preleaseWarning = "";

Expand Down

0 comments on commit 3c16cfe

Please sign in to comment.