File 0001-Add-http2-to-KNewStuff-requests.patch of Package knewstuff.17510

From 4bf0716f3fcac48f5c9587f65611e3b80c26a9f5 Mon Sep 17 00:00:00 2001
From: Dan Leinir Turthra Jensen <admin@leinir.dk>
Date: Tue, 8 Feb 2022 11:41:53 +0000
Subject: [PATCH 1/3] Add http2 to KNewStuff requests

This is a partner to the attica mr[1] which does the same there,
except for any knewstuff requests.

[1] https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/839

(cherry picked from commit 9a98fc12d8b049ef2df73ad46bf628ea99e7c8a5)
---
 src/core/jobs/httpworker.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/core/jobs/httpworker.cpp b/src/core/jobs/httpworker.cpp
index 1903066b..b52161f6 100644
--- a/src/core/jobs/httpworker.cpp
+++ b/src/core/jobs/httpworker.cpp
@@ -99,6 +99,8 @@ static void addUserAgent(QNetworkRequest &request)
         agentHeader += QStringLiteral("-%1/%2").arg(QCoreApplication::instance()->applicationName(), QCoreApplication::instance()->applicationVersion());
     }
     request.setHeader(QNetworkRequest::UserAgentHeader, agentHeader);
+    // If the remote supports HTTP/2, then we should definitely be using that
+    request.setAttribute(QNetworkRequest::Http2AllowedAttribute, true);
 }
 
 void HTTPWorker::startRequest()
-- 
2.33.1

openSUSE Build Service is sponsored by