diff options
author | Rachel Powers <508861+Ryex@users.noreply.github.com> | 2023-06-01 20:31:23 -0700 |
---|---|---|
committer | Rachel Powers <508861+Ryex@users.noreply.github.com> | 2023-06-25 11:09:26 -0700 |
commit | 6db906d62378a040e55c35f196d208bed7aebbef (patch) | |
tree | 15553bfad84a024c87cc9ee8874a615068a5bf7c /launcher/net/ApiHeaderProxy.h | |
parent | 418677ef310ebde9e2ce6fa98e224b6d4d1aa9f4 (diff) | |
download | PrismLauncher-6db906d62378a040e55c35f196d208bed7aebbef.tar.gz PrismLauncher-6db906d62378a040e55c35f196d208bed7aebbef.tar.bz2 PrismLauncher-6db906d62378a040e55c35f196d208bed7aebbef.zip |
chore: format
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
Diffstat (limited to 'launcher/net/ApiHeaderProxy.h')
-rw-r--r-- | launcher/net/ApiHeaderProxy.h | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/launcher/net/ApiHeaderProxy.h b/launcher/net/ApiHeaderProxy.h index 5de503a6..6fd3e4c1 100644 --- a/launcher/net/ApiHeaderProxy.h +++ b/launcher/net/ApiHeaderProxy.h @@ -19,9 +19,9 @@ #pragma once -#include "net/HeaderProxy.h" #include "Application.h" #include "BuildConfig.h" +#include "net/HeaderProxy.h" namespace Net { @@ -31,19 +31,19 @@ class ApiHeaderProxy : public HeaderProxy { virtual ~ApiHeaderProxy() = default; public: - virtual QList<HeaderPair> headers(const QNetworkRequest& request) const override { - QList<HeaderPair> hdrs; - if (APPLICATION->capabilities() & Application::SupportsFlame && request.url().host() == QUrl(BuildConfig.FLAME_BASE_URL).host()) { - hdrs.append({ "x-api-key", APPLICATION->getFlameAPIKey().toUtf8() }); - } else if (request.url().host() == QUrl(BuildConfig.MODRINTH_PROD_URL).host() || - request.url().host() == QUrl(BuildConfig.MODRINTH_STAGING_URL).host()) { - QString token = APPLICATION->getModrinthAPIToken(); - if (!token.isNull()) - hdrs.append({ "Authorization", token.toUtf8() }); - } - return hdrs; + virtual QList<HeaderPair> headers(const QNetworkRequest& request) const override + { + QList<HeaderPair> hdrs; + if (APPLICATION->capabilities() & Application::SupportsFlame && request.url().host() == QUrl(BuildConfig.FLAME_BASE_URL).host()) { + hdrs.append({ "x-api-key", APPLICATION->getFlameAPIKey().toUtf8() }); + } else if (request.url().host() == QUrl(BuildConfig.MODRINTH_PROD_URL).host() || + request.url().host() == QUrl(BuildConfig.MODRINTH_STAGING_URL).host()) { + QString token = APPLICATION->getModrinthAPIToken(); + if (!token.isNull()) + hdrs.append({ "Authorization", token.toUtf8() }); + } + return hdrs; }; - }; } // namespace Net |