summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFedja Beader <fedja@protonmail.ch>2025-06-29 00:11:14 +0200
committerFedja Beader <fedja@protonmail.ch>2025-06-29 00:13:44 +0200
commitd8de4b413ed3f681aafe6e9a8fc447ddfb541cb6 (patch)
tree9b6cb38e5dc99b695491eb5b14f8e2206962d98c
parent427c4ba42ff64cdf4f9c370cfd9c29785a85d27c (diff)
downloadmanaplus-use_urljoin_downloaderwindow.tar.gz
manaplus-use_urljoin_downloaderwindow.tar.bz2
manaplus-use_urljoin_downloaderwindow.tar.xz
manaplus-use_urljoin_downloaderwindow.zip
use urljoin() to join URL components / no longer require slashes in oneuse_urljoin_downloaderwindow
of the components.
-rw-r--r--src/gui/windows/updaterwindow.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/gui/windows/updaterwindow.cpp b/src/gui/windows/updaterwindow.cpp
index 87a2b1894..ecdb9b528 100644
--- a/src/gui/windows/updaterwindow.cpp
+++ b/src/gui/windows/updaterwindow.cpp
@@ -589,15 +589,16 @@ void UpdaterWindow::download()
if (mDownloadStatus == UpdateDownloadStatus::UPDATE_PATCH)
{
mDownload = new Net::Download(this,
- branding.getStringValue("updateMirror1") + mCurrentFile,
+ urlJoin(branding.getStringValue("updateMirror1"), mCurrentFile),
&updateProgress,
true, false, mValidateXml);
+
for (int f = 2; f < 8; f ++)
{
const std::string url = branding.getStringValue(
"updateMirror" + toString(f));
if (!url.empty())
- mDownload->addMirror(url + mCurrentFile);
+ mDownload->addMirror(urlJoin(url, mCurrentFile));
}
}
else
@@ -611,9 +612,9 @@ void UpdaterWindow::download()
mDownloadStatus == UpdateDownloadStatus::UPDATE_RESOURCES2)
{
const std::string str = urlJoin(mUpdateServerPath, mCurrentFile);
- mDownload->addMirror(updateServer3 + str);
- mDownload->addMirror(updateServer4 + str);
- mDownload->addMirror(updateServer5 + str);
+ mDownload->addMirror(urlJoin(updateServer3, str));
+ mDownload->addMirror(urlJoin(updateServer4, str));
+ mDownload->addMirror(urlJoin(updateServer5, str));
}
else
{
@@ -828,7 +829,7 @@ void UpdaterWindow::logic()
// Parse current memory buffer as news and dispose of the data
loadPatch();
- mUpdateHost = updateServer2 + mUpdateServerPath;
+ mUpdateHost = urlJoin(updateServer2, mUpdateServerPath);
mUpdatesDir = pathJoin(mUpdatesDir, "fix");
mCurrentFile = xmlUpdateFile;
mValidateXml = true;