fix: validate whitelisted download urls

This commit is contained in:
flow committed 2022-05-15 16:06:49 -03:00
1 parent 78cf0c73c8
commit 7194bb1b81
3 files changed
+26 -3

No files matched your search

+1 -1
View File
@@ -545,7 +545,7 @@ void InstanceImportTask::processModrinth() {
file.hashAlgorithm = hashAlgorithm;
// Do not use requireUrl, which uses StrictMode, instead use QUrl's default TolerantMode (as Modrinth seems to incorrectly handle spaces)
file.download = Json::requireString(Json::ensureArray(obj, "downloads").first(), "Download URL for " + file.path);
if (!file.download.isValid())
if (!file.download.isValid() || !Modrinth::validadeDownloadUrl(file.download))
{
throw JSONValidationError("Download URL for " + file.path + " is not a correctly formatted URL");
}