aboutsummaryrefslogtreecommitdiff
path: root/launcher/net/Download.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'launcher/net/Download.cpp')
-rw-r--r--launcher/net/Download.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/launcher/net/Download.cpp b/launcher/net/Download.cpp
index 5982c8c9..0816e926 100644
--- a/launcher/net/Download.cpp
+++ b/launcher/net/Download.cpp
@@ -3,6 +3,7 @@
* PolyMC - Minecraft Launcher
* Copyright (c) 2022 flowln <flowlnlnln@gmail.com>
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
+ * Copyright (C) 2023 TheKodeToad <TheKodeToad@proton.me>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -116,7 +117,11 @@ void Download::executeTask()
if (APPLICATION->capabilities() & Application::SupportsFlame
&& request.url().host().contains("api.curseforge.com")) {
request.setRawHeader("x-api-key", APPLICATION->getFlameAPIKey().toUtf8());
- };
+ } else if (request.url().host().contains("api.modrinth.com")) {
+ QString token = APPLICATION->getModrinthAPIToken();
+ if (!token.isNull())
+ request.setRawHeader("Authorization", token.toUtf8());
+ }
QNetworkReply* rep = m_network->get(request);