aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/thread/ProxyConnectionTestTask.cpp
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2024-03-02 18:22:27 +0000
committersaturneric <[email protected]>2024-03-02 18:22:27 +0000
commit3a0b2bd05af92fff313dcc6fa34fb87ac8030746 (patch)
tree420cc23dc12ca947e39906981c8814e04b51e0c4 /src/ui/thread/ProxyConnectionTestTask.cpp
parentfix: change GpgFrontend to Gpg Frontend on linux platform (diff)
parentfeat: add user agent header when doing http request (diff)
downloadGpgFrontend-3a0b2bd05af92fff313dcc6fa34fb87ac8030746.tar.gz
GpgFrontend-3a0b2bd05af92fff313dcc6fa34fb87ac8030746.zip
Merge branch 'dev/2.1.2/main' into develop
Diffstat (limited to 'src/ui/thread/ProxyConnectionTestTask.cpp')
-rw-r--r--src/ui/thread/ProxyConnectionTestTask.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/ui/thread/ProxyConnectionTestTask.cpp b/src/ui/thread/ProxyConnectionTestTask.cpp
index b681ca6d..003205e5 100644
--- a/src/ui/thread/ProxyConnectionTestTask.cpp
+++ b/src/ui/thread/ProxyConnectionTestTask.cpp
@@ -30,6 +30,8 @@
#include <QtNetwork>
+#include "GpgFrontendBuildInfo.h"
+
GpgFrontend::UI::ProxyConnectionTestTask::ProxyConnectionTestTask(QString url,
int timeout)
: Task("proxy_connection_test_task"),
@@ -40,7 +42,10 @@ GpgFrontend::UI::ProxyConnectionTestTask::ProxyConnectionTestTask(QString url,
}
auto GpgFrontend::UI::ProxyConnectionTestTask::Run() -> int {
- auto* network_reply = network_manager_->get(QNetworkRequest{url_});
+ auto request = QNetworkRequest(url_);
+ request.setHeader(QNetworkRequest::UserAgentHeader, HTTP_REQUEST_USER_AGENT);
+
+ auto* network_reply = network_manager_->get(request);
auto* timer = new QTimer(this);
connect(network_reply, &QNetworkReply::finished, this,