diff options
author | Petr Mrázek <peterix@gmail.com> | 2015-05-31 17:51:20 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2015-05-31 17:51:20 +0200 |
commit | ff64b6cf1d21e35cbc10ebc6cf3838f5b0244355 (patch) | |
tree | 3d8cf8491aaba702a1ccf2280136a0689af1519c /logic/minecraft/RawLibrary.cpp | |
parent | 84757f485b51bd54926807d05fe4fa503a09ea4c (diff) | |
download | MultiMC-ff64b6cf1d21e35cbc10ebc6cf3838f5b0244355.tar MultiMC-ff64b6cf1d21e35cbc10ebc6cf3838f5b0244355.tar.gz MultiMC-ff64b6cf1d21e35cbc10ebc6cf3838f5b0244355.tar.lz MultiMC-ff64b6cf1d21e35cbc10ebc6cf3838f5b0244355.tar.xz MultiMC-ff64b6cf1d21e35cbc10ebc6cf3838f5b0244355.zip |
GH-1020 use plain strings for library URLs
Because the URLs can contain {}, which are percent encoded in URLs and this breaks variable substitution
Diffstat (limited to 'logic/minecraft/RawLibrary.cpp')
-rw-r--r-- | logic/minecraft/RawLibrary.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/logic/minecraft/RawLibrary.cpp b/logic/minecraft/RawLibrary.cpp index fa8270cd..bae6c66a 100644 --- a/logic/minecraft/RawLibrary.cpp +++ b/logic/minecraft/RawLibrary.cpp @@ -157,7 +157,7 @@ QJsonObject RawLibrary::toJson() const m_base_url != "https://" + URLConstants::AWS_DOWNLOAD_LIBRARIES && m_base_url != "https://" + URLConstants::LIBRARY_BASE && !m_base_url.isEmpty()) { - libRoot.insert("url", m_base_url.toString()); + libRoot.insert("url", m_base_url); } if (isNative()) { @@ -224,7 +224,7 @@ bool RawLibrary::filesExist(const QDir &base) const } return true; } -QUrl RawLibrary::url() const +QString RawLibrary::url() const { if (!m_absolute_url.isEmpty()) { @@ -236,7 +236,14 @@ QUrl RawLibrary::url() const return QString("https://" + URLConstants::LIBRARY_BASE) + storageSuffix(); } - return m_base_url.resolved(storageSuffix()); + if(m_base_url.endsWith('/')) + { + return m_base_url + storageSuffix(); + } + else + { + return m_base_url + QChar('/') + storageSuffix(); + } } bool RawLibrary::isActive() const |