diff options
author | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2021-06-13 18:15:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-13 18:15:36 +0200 |
commit | d20aa002c0dcb2b40bbf7b48c5c995a5ed8138c1 (patch) | |
tree | 713338c8bde5e6784bbdfcdee29cafc1f9eb36d4 /lib/jobs | |
parent | 0571ba1fb1948a6cc050230a85201291ababbf04 (diff) | |
parent | 083f62f58bc525d761969133e12a859de9b29648 (diff) | |
download | libquotient-d20aa002c0dcb2b40bbf7b48c5c995a5ed8138c1.tar.gz libquotient-d20aa002c0dcb2b40bbf7b48c5c995a5ed8138c1.zip |
Merge pull request #480 from quotient-im/kitsune-qt6-compat
Qt 6 support
Diffstat (limited to 'lib/jobs')
-rw-r--r-- | lib/jobs/basejob.cpp | 3 | ||||
-rw-r--r-- | lib/jobs/requestdata.cpp | 5 | ||||
-rw-r--r-- | lib/jobs/requestdata.h | 3 |
3 files changed, 8 insertions, 3 deletions
diff --git a/lib/jobs/basejob.cpp b/lib/jobs/basejob.cpp index 48c2996d..c27c6a89 100644 --- a/lib/jobs/basejob.cpp +++ b/lib/jobs/basejob.cpp @@ -288,7 +288,8 @@ void BaseJob::Private::sendRequest() req.setRawHeader("Authorization", QByteArray("Bearer ") + connection->accessToken()); req.setAttribute(QNetworkRequest::BackgroundRequestAttribute, inBackground); - req.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true); + req.setAttribute(QNetworkRequest::RedirectPolicyAttribute, + QNetworkRequest::NoLessSafeRedirectPolicy); req.setMaximumRedirectsAllowed(10); req.setAttribute(QNetworkRequest::HttpPipeliningAllowedAttribute, true); req.setAttribute( diff --git a/lib/jobs/requestdata.cpp b/lib/jobs/requestdata.cpp index 047e2920..2c001ccc 100644 --- a/lib/jobs/requestdata.cpp +++ b/lib/jobs/requestdata.cpp @@ -3,6 +3,7 @@ #include "requestdata.h" +#include <QtCore/QIODevice> #include <QtCore/QBuffer> #include <QtCore/QByteArray> #include <QtCore/QJsonArray> @@ -31,4 +32,8 @@ RequestData::RequestData(const QJsonObject& jo) : _source(fromJson(jo)) {} RequestData::RequestData(const QJsonArray& ja) : _source(fromJson(ja)) {} +RequestData::RequestData(QIODevice* source) + : _source(std::unique_ptr<QIODevice>(source)) +{} + RequestData::~RequestData() = default; diff --git a/lib/jobs/requestdata.h b/lib/jobs/requestdata.h index 4958e0f9..21657631 100644 --- a/lib/jobs/requestdata.h +++ b/lib/jobs/requestdata.h @@ -24,8 +24,7 @@ public: RequestData(const QByteArray& a = {}); RequestData(const QJsonObject& jo); RequestData(const QJsonArray& ja); - RequestData(QIODevice* source) : _source(std::unique_ptr<QIODevice>(source)) - {} + RequestData(QIODevice* source); RequestData(RequestData&&) = default; RequestData& operator=(RequestData&&) = default; ~RequestData(); |