summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2018-01-29 00:47:18 +0100
committerPetr Mrázek <peterix@gmail.com>2018-01-29 00:47:18 +0100
commit088e8e0effa3842932b38651dce93ff6a470bba4 (patch)
tree1c93a52d9040c0acae730213b664ef0f9ed9bc87
parent418251bd8668ea013caf3980281f75b625d41260 (diff)
downloadMultiMC-088e8e0effa3842932b38651dce93ff6a470bba4.tar
MultiMC-088e8e0effa3842932b38651dce93ff6a470bba4.tar.gz
MultiMC-088e8e0effa3842932b38651dce93ff6a470bba4.tar.lz
MultiMC-088e8e0effa3842932b38651dce93ff6a470bba4.tar.xz
MultiMC-088e8e0effa3842932b38651dce93ff6a470bba4.zip
NOISSUE remove unneeded URL fixing code and fix up the exception thrown by invalid Flame URLs
-rw-r--r--api/logic/minecraft/flame/FileResolvingTask.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/api/logic/minecraft/flame/FileResolvingTask.cpp b/api/logic/minecraft/flame/FileResolvingTask.cpp
index 980b8c3a..efc73621 100644
--- a/api/logic/minecraft/flame/FileResolvingTask.cpp
+++ b/api/logic/minecraft/flame/FileResolvingTask.cpp
@@ -48,12 +48,11 @@ void Flame::FileResolvingTask::netJobFinished()
continue;
}
out.fileName = Json::requireString(obj, "FileNameOnDisk");
- auto urlString = Json::requireString(obj, "DownloadURL");
- urlString.replace(' ', "%20");
- out.url = QUrl(urlString, QUrl::StrictMode);
+ QString rawUrl = Json::requireString(obj, "DownloadURL");
+ out.url = QUrl(rawUrl, QUrl::TolerantMode);
if(!out.url.isValid())
{
- throw "Perkele!";
+ throw JSONValidationError(QString("Invalid URL: %1").arg(rawUrl));
}
// This is a piece of a Flame project JSON pulled out into the file metadata (here) for convenience
// It is also optional