diff --git a/src/libsync/abstractnetworkjob.cpp b/src/libsync/abstractnetworkjob.cpp index bf12bcffed5..f62281c3442 100644 --- a/src/libsync/abstractnetworkjob.cpp +++ b/src/libsync/abstractnetworkjob.cpp @@ -157,8 +157,6 @@ void AbstractNetworkJob::sendRequest(const QByteArray &verb, _verb = verb; _request = req; - // we don't follow redirects, if we receive one the ConnectionValidor is triggered - _request.setAttribute(QNetworkRequest::RedirectPolicyAttribute, QNetworkRequest::ManualRedirectPolicy); // allow to transfer files with a big compression ratio _request.setDecompressedSafetyCheckThreshold(-1); diff --git a/src/libsync/accessmanager.cpp b/src/libsync/accessmanager.cpp index bf41921a6b3..35fe0659298 100644 --- a/src/libsync/accessmanager.cpp +++ b/src/libsync/accessmanager.cpp @@ -65,6 +65,12 @@ QNetworkReply *AccessManager::createRequest(QNetworkAccessManager::Operation op, // Set the language, so messages from the server are localised correctly. newRequest.setRawHeader("Accept-Language", QLocale().name().toUtf8()); + // we don't follow redirects, if we receive one the ConnectionValidor is triggered + // -> default to manual redirection + if (newRequest.attribute(QNetworkRequest::RedirectPolicyAttribute).isNull()) { + newRequest.setAttribute(QNetworkRequest::RedirectPolicyAttribute, QNetworkRequest::ManualRedirectPolicy); + } + QByteArray verb = newRequest.attribute(QNetworkRequest::CustomVerbAttribute).toByteArray(); // For PROPFIND (assumed to be a WebDAV op), set xml/utf8 as content type/encoding // This needs extension