aboutsummaryrefslogtreecommitdiff
path: root/launcher/net
diff options
context:
space:
mode:
authorSefa Eyeoglu <contact@scrumplex.net>2022-08-08 20:49:49 +0200
committerSefa Eyeoglu <contact@scrumplex.net>2022-08-08 21:16:37 +0200
commitf873cd5b1aa17fe8119f27cc5d9b9eba10bd42bf (patch)
tree34ddbf24cfed468811c289f2dbf790148ad9c337 /launcher/net
parent75f92de8f8517142289dc76d071cfb4fa724598c (diff)
downloadPrismLauncher-f873cd5b1aa17fe8119f27cc5d9b9eba10bd42bf.tar.gz
PrismLauncher-f873cd5b1aa17fe8119f27cc5d9b9eba10bd42bf.tar.bz2
PrismLauncher-f873cd5b1aa17fe8119f27cc5d9b9eba10bd42bf.zip
refactor: store current capabilities
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
Diffstat (limited to 'launcher/net')
-rw-r--r--launcher/net/Download.cpp2
-rw-r--r--launcher/net/Upload.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/launcher/net/Download.cpp b/launcher/net/Download.cpp
index e6a6adcc..8db11eaa 100644
--- a/launcher/net/Download.cpp
+++ b/launcher/net/Download.cpp
@@ -118,7 +118,7 @@ void Download::executeTask()
}
request.setHeader(QNetworkRequest::UserAgentHeader, APPLICATION->getUserAgent().toUtf8());
- if (APPLICATION->currentCapabilities() & Application::SupportsFlame
+ if (APPLICATION->capabilities() & Application::SupportsFlame
&& request.url().host().contains("api.curseforge.com")) {
request.setRawHeader("x-api-key", APPLICATION->getFlameAPIKey().toUtf8());
};
diff --git a/launcher/net/Upload.cpp b/launcher/net/Upload.cpp
index cfda4b4e..f3b19022 100644
--- a/launcher/net/Upload.cpp
+++ b/launcher/net/Upload.cpp
@@ -216,7 +216,7 @@ namespace Net {
}
request.setHeader(QNetworkRequest::UserAgentHeader, APPLICATION->getUserAgent().toUtf8());
- if (APPLICATION->currentCapabilities() & Application::SupportsFlame
+ if (APPLICATION->capabilities() & Application::SupportsFlame
&& request.url().host().contains("api.curseforge.com")) {
request.setRawHeader("x-api-key", APPLICATION->getFlameAPIKey().toUtf8());
}