aboutsummaryrefslogtreecommitdiff
path: root/launcher/screenshots
diff options
context:
space:
mode:
authorRyan Cao <70191398+ryanccn@users.noreply.github.com>2022-06-04 15:33:17 +0800
committerRyan Cao <70191398+ryanccn@users.noreply.github.com>2022-06-04 15:33:17 +0800
commit25ab121e42f624352bb4f32faa29e9e455328f09 (patch)
treedc9e1ff5a800196f4072a8fa019cf615e721b3ab /launcher/screenshots
parent04a3669fc470130a5d7f2dfd32f06a3f2aceb165 (diff)
downloadPrismLauncher-25ab121e42f624352bb4f32faa29e9e455328f09.tar.gz
PrismLauncher-25ab121e42f624352bb4f32faa29e9e455328f09.tar.bz2
PrismLauncher-25ab121e42f624352bb4f32faa29e9e455328f09.zip
feat: custom user-agent
Diffstat (limited to 'launcher/screenshots')
-rw-r--r--launcher/screenshots/ImgurAlbumCreation.cpp2
-rw-r--r--launcher/screenshots/ImgurUpload.cpp3
2 files changed, 3 insertions, 2 deletions
diff --git a/launcher/screenshots/ImgurAlbumCreation.cpp b/launcher/screenshots/ImgurAlbumCreation.cpp
index 7afdc5cc..04e26ea2 100644
--- a/launcher/screenshots/ImgurAlbumCreation.cpp
+++ b/launcher/screenshots/ImgurAlbumCreation.cpp
@@ -55,7 +55,7 @@ void ImgurAlbumCreation::executeTask()
{
m_state = State::Running;
QNetworkRequest request(m_url);
- request.setHeader(QNetworkRequest::UserAgentHeader, BuildConfig.USER_AGENT_UNCACHED);
+ request.setHeader(QNetworkRequest::UserAgentHeader, APPLICATION->getUserAgentUncached().toUtf8());
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
request.setRawHeader("Authorization", QString("Client-ID %1").arg(BuildConfig.IMGUR_CLIENT_ID).toStdString().c_str());
request.setRawHeader("Accept", "application/json");
diff --git a/launcher/screenshots/ImgurUpload.cpp b/launcher/screenshots/ImgurUpload.cpp
index fbcfb95f..9aeb6fb8 100644
--- a/launcher/screenshots/ImgurUpload.cpp
+++ b/launcher/screenshots/ImgurUpload.cpp
@@ -35,6 +35,7 @@
#include "ImgurUpload.h"
#include "BuildConfig.h"
+#include "Application.h"
#include <QNetworkRequest>
#include <QHttpMultiPart>
@@ -56,7 +57,7 @@ void ImgurUpload::executeTask()
finished = false;
m_state = Task::State::Running;
QNetworkRequest request(m_url);
- request.setHeader(QNetworkRequest::UserAgentHeader, BuildConfig.USER_AGENT_UNCACHED);
+ request.setHeader(QNetworkRequest::UserAgentHeader, APPLICATION->getUserAgentUncached().toUtf8());
request.setRawHeader("Authorization", QString("Client-ID %1").arg(BuildConfig.IMGUR_CLIENT_ID).toStdString().c_str());
request.setRawHeader("Accept", "application/json");