From 630aefb32b9ebf9e7e1762a62e0c59c38e27b623 Mon Sep 17 00:00:00 2001 From: Camila Ayres Date: Wed, 29 May 2024 21:24:17 +0200 Subject: [PATCH] Only "http"->"http", "http" -> "https" or "https" -> "https" redirects are allowed. Signed-off-by: Camila Ayres --- src/libsync/abstractnetworkjob.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libsync/abstractnetworkjob.cpp b/src/libsync/abstractnetworkjob.cpp index 73640273b2480..24826b44c77d2 100644 --- a/src/libsync/abstractnetworkjob.cpp +++ b/src/libsync/abstractnetworkjob.cpp @@ -127,6 +127,7 @@ QNetworkReply *AbstractNetworkJob::addTimer(QNetworkReply *reply) QNetworkReply *AbstractNetworkJob::sendRequest(const QByteArray &verb, const QUrl &url, QNetworkRequest req, QIODevice *requestBody) { + req.setAttribute(QNetworkRequest::RedirectPolicyAttribute, QNetworkRequest::NoLessSafeRedirectPolicy); auto reply = _account->sendRawRequest(verb, url, req, requestBody); _requestBody = requestBody; if (_requestBody) { @@ -139,6 +140,7 @@ QNetworkReply *AbstractNetworkJob::sendRequest(const QByteArray &verb, const QUr QNetworkReply *AbstractNetworkJob::sendRequest(const QByteArray &verb, const QUrl &url, QNetworkRequest req, const QByteArray &requestBody) { + req.setAttribute(QNetworkRequest::RedirectPolicyAttribute, QNetworkRequest::NoLessSafeRedirectPolicy); auto reply = _account->sendRawRequest(verb, url, req, requestBody); _requestBody = nullptr; adoptRequest(reply); @@ -150,6 +152,7 @@ QNetworkReply *AbstractNetworkJob::sendRequest(const QByteArray &verb, QNetworkRequest req, QHttpMultiPart *requestBody) { + req.setAttribute(QNetworkRequest::RedirectPolicyAttribute, QNetworkRequest::NoLessSafeRedirectPolicy); auto reply = _account->sendRawRequest(verb, url, req, requestBody); _requestBody = nullptr; adoptRequest(reply);