From d8de4b413ed3f681aafe6e9a8fc447ddfb541cb6 Mon Sep 17 00:00:00 2001 From: Fedja Beader Date: Sun, 29 Jun 2025 00:11:14 +0200 Subject: use urljoin() to join URL components / no longer require slashes in one of the components. --- src/gui/windows/updaterwindow.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/gui/windows/updaterwindow.cpp') 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; -- cgit v1.2.3-70-g09d2