NOISSUE fix bad redirect URLs provided by the curse CDN
MultiMC now parses the HTTP Location header in a (more) tolerant mode.
This commit is contained in:
@ -48,7 +48,13 @@ void Flame::FileResolvingTask::netJobFinished()
|
||||
continue;
|
||||
}
|
||||
out.fileName = Json::requireString(obj, "FileNameOnDisk");
|
||||
out.url = Json::requireString(obj, "DownloadURL");
|
||||
auto urlString = Json::requireString(obj, "DownloadURL");
|
||||
urlString.replace(' ', "%20");
|
||||
out.url = QUrl(urlString, QUrl::StrictMode);
|
||||
if(!out.url.isValid())
|
||||
{
|
||||
throw "Perkele!";
|
||||
}
|
||||
// This is a piece of a Flame project JSON pulled out into the file metadata (here) for convenience
|
||||
// It is also optional
|
||||
QJsonObject projObj = Json::ensureObject(obj, "_Project", {});
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
#include <QString>
|
||||
#include <QVector>
|
||||
#include <QUrl>
|
||||
|
||||
namespace Flame
|
||||
{
|
||||
@ -15,7 +16,7 @@ struct File
|
||||
// our
|
||||
bool resolved = false;
|
||||
QString fileName;
|
||||
QString url;
|
||||
QUrl url;
|
||||
QString targetFolder = QLatin1Literal("mods");
|
||||
enum class Type
|
||||
{
|
||||
|
Reference in New Issue
Block a user