From 4a1a5fa0764d2dbed076cfeb17e9aee6a4b856b7 Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Fri, 3 Mar 2017 11:20:53 +0100 Subject: AbstractNetworkJob: Improve redirect handling #5555 * For requests: - reuse the original QNetworkRequest, so headers and attributes are the same as in the original request - determine the original http method from the reply and the request attributes - keep the original request body around such that it can be sent again in case the request is redirected * Simplify the interface that is used for creating new requests in AbstractNetworkJob. --- test/syncenginetestutils.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/syncenginetestutils.h') diff --git a/test/syncenginetestutils.h b/test/syncenginetestutils.h index 937bf35fd..64b063284 100644 --- a/test/syncenginetestutils.h +++ b/test/syncenginetestutils.h @@ -730,13 +730,13 @@ protected: if (verb == QLatin1String("PROPFIND")) // Ignore outgoingData always returning somethign good enough, works for now. return new FakePropfindReply{info, op, request, this}; - else if (verb == QLatin1String("GET")) + else if (verb == QLatin1String("GET") || op == QNetworkAccessManager::GetOperation) return new FakeGetReply{info, op, request, this}; - else if (verb == QLatin1String("PUT")) + else if (verb == QLatin1String("PUT") || op == QNetworkAccessManager::PutOperation) return new FakePutReply{info, op, request, outgoingData->readAll(), this}; else if (verb == QLatin1String("MKCOL")) return new FakeMkcolReply{info, op, request, this}; - else if (verb == QLatin1String("DELETE")) + else if (verb == QLatin1String("DELETE") || op == QNetworkAccessManager::DeleteOperation) return new FakeDeleteReply{info, op, request, this}; else if (verb == QLatin1String("MOVE") && !isUpload) return new FakeMoveReply{info, op, request, this}; -- cgit v1.2.3