From 088e8e0effa3842932b38651dce93ff6a470bba4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Mon, 29 Jan 2018 00:47:18 +0100 Subject: NOISSUE remove unneeded URL fixing code and fix up the exception thrown by invalid Flame URLs --- api/logic/minecraft/flame/FileResolvingTask.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'api/logic/minecraft/flame/FileResolvingTask.cpp') 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 -- cgit v1.2.3