diff options
author | Petr Mrázek <peterix@gmail.com> | 2018-01-29 00:47:18 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2018-01-29 00:47:18 +0100 |
commit | 088e8e0effa3842932b38651dce93ff6a470bba4 (patch) | |
tree | 1c93a52d9040c0acae730213b664ef0f9ed9bc87 /api/logic/minecraft | |
parent | 418251bd8668ea013caf3980281f75b625d41260 (diff) | |
download | MultiMC-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
Diffstat (limited to 'api/logic/minecraft')
-rw-r--r-- | api/logic/minecraft/flame/FileResolvingTask.cpp | 7 |
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 |