mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-22 13:05:51 +03:00
Provide different propfind replies depending on request props in testfiletagmode
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
89d7e17674
commit
ccb07af56a
1 changed files with 7 additions and 8 deletions
|
@ -54,7 +54,6 @@ private slots:
|
|||
Q_UNUSED(device);
|
||||
QNetworkReply *reply = nullptr;
|
||||
|
||||
const auto urlQuery = QUrlQuery(req.url());
|
||||
const auto path = req.url().path();
|
||||
|
||||
auto requestDom = QDomDocument();
|
||||
|
@ -63,23 +62,23 @@ private slots:
|
|||
const auto systemTagElems = requestDom.elementsByTagName("system-tags");
|
||||
|
||||
if (!parsedCorrectly || !req.url().toString().startsWith(_accountState->account()->url().toString())) {
|
||||
reply = new FakePayloadReply(op, req, testErrorXmlResponse, qnamDelay, _fakeQnam.data());
|
||||
reply = new FakePropfindReply(testErrorXmlResponse, op, req, this);
|
||||
}
|
||||
|
||||
if (path.startsWith(testUrlPath)) {
|
||||
if (path.contains(testUrlPath)) {
|
||||
if (tagElems.count() > 0 && systemTagElems.count() > 0) {
|
||||
reply = new FakePayloadReply(op, req, testSystemAndNormalTagsOnlyXmlResponse, qnamDelay, _fakeQnam.data());
|
||||
reply = new FakePropfindReply(testSystemAndNormalTagsOnlyXmlResponse, op, req, this);
|
||||
} else if (tagElems.count() > 0) {
|
||||
reply = new FakePayloadReply(op, req, testTagsOnlyXmlResponse, qnamDelay, _fakeQnam.data());
|
||||
reply = new FakePropfindReply(testTagsOnlyXmlResponse, op, req, this);
|
||||
} else if (systemTagElems.count() > 0) {
|
||||
reply = new FakePayloadReply(op, req, testSystemTagsOnlyXmlResponse, qnamDelay, _fakeQnam.data());
|
||||
reply = new FakePropfindReply(testSystemTagsOnlyXmlResponse, op, req, this);
|
||||
} else {
|
||||
reply = new FakePayloadReply(op, req, testTaglessXmlResponse, qnamDelay, _fakeQnam.data());
|
||||
reply = new FakePropfindReply(testTaglessXmlResponse, op, req, this);
|
||||
}
|
||||
}
|
||||
|
||||
if (!reply) {
|
||||
reply = new FakePayloadReply(op, req, testErrorXmlResponse, qnamDelay, _fakeQnam.data());
|
||||
reply = new FakePropfindReply(testErrorXmlResponse, op, req, this);
|
||||
}
|
||||
|
||||
return reply;
|
||||
|
|
Loading…
Reference in a new issue