aboutsummaryrefslogtreecommitdiff
path: root/launcher/net/ApiHeaderProxy.h
diff options
context:
space:
mode:
authorRachel Powers <508861+Ryex@users.noreply.github.com>2023-06-01 20:15:39 -0700
committerRachel Powers <508861+Ryex@users.noreply.github.com>2023-06-25 11:09:25 -0700
commit418677ef310ebde9e2ce6fa98e224b6d4d1aa9f4 (patch)
tree77a13e01c91575bced101f6b899577d6294d5596 /launcher/net/ApiHeaderProxy.h
parent9c10965997d873b0de56deef5d5ec5e768db1d8f (diff)
downloadPrismLauncher-418677ef310ebde9e2ce6fa98e224b6d4d1aa9f4.tar.gz
PrismLauncher-418677ef310ebde9e2ce6fa98e224b6d4d1aa9f4.tar.bz2
PrismLauncher-418677ef310ebde9e2ce6fa98e224b6d4d1aa9f4.zip
refactor: override / mask static `make` functions for ApiDownload
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
Diffstat (limited to 'launcher/net/ApiHeaderProxy.h')
-rw-r--r--launcher/net/ApiHeaderProxy.h28
1 files changed, 13 insertions, 15 deletions
diff --git a/launcher/net/ApiHeaderProxy.h b/launcher/net/ApiHeaderProxy.h
index 0da92a74..5de503a6 100644
--- a/launcher/net/ApiHeaderProxy.h
+++ b/launcher/net/ApiHeaderProxy.h
@@ -1,8 +1,6 @@
// SPDX-License-Identifier: GPL-3.0-only
/*
* Prism Launcher - Minecraft Launcher
- * Copyright (c) 2022 flowln <flowlnlnln@gmail.com>
- * Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
* Copyright (C) 2023 Rachel Powers <508861+Ryex@users.noreply.github.com>
*
* This program is free software: you can redistribute it and/or modify
@@ -21,9 +19,9 @@
#pragma once
+#include "net/HeaderProxy.h"
#include "Application.h"
#include "BuildConfig.h"
-#include "net/HeaderProxy.h"
namespace Net {
@@ -33,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