|
@@ -6,6 +6,8 @@
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
#include "syncenginetestutils.h"
|
|
#include "syncenginetestutils.h"
|
|
|
|
|
+#include "httplogger.h"
|
|
|
|
|
+#include "accessmanager.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <memory>
|
|
#include <memory>
|
|
@@ -803,27 +805,30 @@ QNetworkReply *FakeQNAM::createRequest(QNetworkAccessManager::Operation op, cons
|
|
|
bool isUpload = request.url().path().startsWith(sUploadUrl.path());
|
|
bool isUpload = request.url().path().startsWith(sUploadUrl.path());
|
|
|
FileInfo &info = isUpload ? _uploadFileInfo : _remoteRootFileInfo;
|
|
FileInfo &info = isUpload ? _uploadFileInfo : _remoteRootFileInfo;
|
|
|
|
|
|
|
|
|
|
+ auto newRequest = request;
|
|
|
|
|
+ newRequest.setRawHeader("X-Request-ID", OCC::AccessManager::generateRequestId());
|
|
|
auto verb = request.attribute(QNetworkRequest::CustomVerbAttribute);
|
|
auto verb = request.attribute(QNetworkRequest::CustomVerbAttribute);
|
|
|
FakeReply *reply = nullptr;
|
|
FakeReply *reply = nullptr;
|
|
|
if (verb == QLatin1String("PROPFIND"))
|
|
if (verb == QLatin1String("PROPFIND"))
|
|
|
// Ignore outgoingData always returning somethign good enough, works for now.
|
|
// Ignore outgoingData always returning somethign good enough, works for now.
|
|
|
- reply = new FakePropfindReply { info, op, request, this };
|
|
|
|
|
|
|
+ reply = new FakePropfindReply { info, op, newRequest, this };
|
|
|
else if (verb == QLatin1String("GET") || op == QNetworkAccessManager::GetOperation)
|
|
else if (verb == QLatin1String("GET") || op == QNetworkAccessManager::GetOperation)
|
|
|
- reply = new FakeGetReply { info, op, request, this };
|
|
|
|
|
|
|
+ reply = new FakeGetReply { info, op, newRequest, this };
|
|
|
else if (verb == QLatin1String("PUT") || op == QNetworkAccessManager::PutOperation)
|
|
else if (verb == QLatin1String("PUT") || op == QNetworkAccessManager::PutOperation)
|
|
|
- reply = new FakePutReply { info, op, request, outgoingData->readAll(), this };
|
|
|
|
|
|
|
+ reply = new FakePutReply { info, op, newRequest, outgoingData->readAll(), this };
|
|
|
else if (verb == QLatin1String("MKCOL"))
|
|
else if (verb == QLatin1String("MKCOL"))
|
|
|
- reply = new FakeMkcolReply { info, op, request, this };
|
|
|
|
|
|
|
+ reply = new FakeMkcolReply { info, op, newRequest, this };
|
|
|
else if (verb == QLatin1String("DELETE") || op == QNetworkAccessManager::DeleteOperation)
|
|
else if (verb == QLatin1String("DELETE") || op == QNetworkAccessManager::DeleteOperation)
|
|
|
- reply = new FakeDeleteReply { info, op, request, this };
|
|
|
|
|
|
|
+ reply = new FakeDeleteReply { info, op, newRequest, this };
|
|
|
else if (verb == QLatin1String("MOVE") && !isUpload)
|
|
else if (verb == QLatin1String("MOVE") && !isUpload)
|
|
|
- reply = new FakeMoveReply { info, op, request, this };
|
|
|
|
|
|
|
+ reply = new FakeMoveReply { info, op, newRequest, this };
|
|
|
else if (verb == QLatin1String("MOVE") && isUpload)
|
|
else if (verb == QLatin1String("MOVE") && isUpload)
|
|
|
- reply = new FakeChunkMoveReply { info, _remoteRootFileInfo, op, request, this };
|
|
|
|
|
|
|
+ reply = new FakeChunkMoveReply { info, _remoteRootFileInfo, op, newRequest, this };
|
|
|
else {
|
|
else {
|
|
|
qDebug() << verb << outgoingData;
|
|
qDebug() << verb << outgoingData;
|
|
|
Q_UNREACHABLE();
|
|
Q_UNREACHABLE();
|
|
|
}
|
|
}
|
|
|
|
|
+ OCC::HttpLogger::logRequest(reply, op, outgoingData);
|
|
|
return reply;
|
|
return reply;
|
|
|
}
|
|
}
|
|
|
|
|
|