From 77433f7e1d6ef4323746f1590a414d72c4a1aa43 Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Mon, 26 Jul 2021 08:56:48 +0200 Subject: [PATCH] in wizard always use the correct way to get dav path fixes listing being incorrect when using dav endpoint Signed-off-by: Matthieu Gallien --- src/libsync/account.cpp | 13 +------------ test/testallfilesdeleted.cpp | 5 +++-- test/testremotediscovery.cpp | 4 ++-- 3 files changed, 6 insertions(+), 16 deletions(-) diff --git a/src/libsync/account.cpp b/src/libsync/account.cpp index 42b605300..d2b6e19b6 100644 --- a/src/libsync/account.cpp +++ b/src/libsync/account.cpp @@ -85,18 +85,7 @@ Account::~Account() = default; QString Account::davPath() const { - if (capabilities().chunkingNg()) { - // The chunking-ng means the server prefer to use the new webdav URL - return QLatin1String("/remote.php/dav/files/") + davUser() + QLatin1Char('/'); - } - - // make sure to have a trailing slash - if (!_davPath.endsWith('/')) { - QString dp(_davPath); - dp.append('/'); - return dp; - } - return _davPath; + return QLatin1String("/remote.php/dav/files/") + davUser() + QLatin1Char('/'); } void Account::setSharedThis(AccountPtr sharedThis) diff --git a/test/testallfilesdeleted.cpp b/test/testallfilesdeleted.cpp index c3436cecd..c881b6914 100644 --- a/test/testallfilesdeleted.cpp +++ b/test/testallfilesdeleted.cpp @@ -214,10 +214,11 @@ private slots: if (verb == "PROPFIND") { auto data = stream->readAll(); if (data.contains("data-fingerprint")) { - if (request.url().path().endsWith("dav/")) + if (request.url().path().endsWith("dav/files/admin/")) { ++fingerprintRequests; - else + } else { fingerprintRequests = -10000; // fingerprint queried on incorrect path + } } } return nullptr; diff --git a/test/testremotediscovery.cpp b/test/testremotediscovery.cpp index 4e92ca744..cf27ae1c2 100644 --- a/test/testremotediscovery.cpp +++ b/test/testremotediscovery.cpp @@ -91,7 +91,7 @@ private slots: auto oldLocalState = fakeFolder.currentLocalState(); auto oldRemoteState = fakeFolder.currentRemoteState(); - QString errorFolder = "dav/B"; + QString errorFolder = "dav/files/admin/B"; QString fatalErrorPrefix = "Server replied with an error while reading directory 'B' : "; fakeFolder.setServerOverride([&](QNetworkAccessManager::Operation op, const QNetworkRequest &req, QIODevice *) -> QNetworkReply *{ @@ -133,7 +133,7 @@ private slots: // // Check the same discovery error on the sync root // - errorFolder = "dav/"; + errorFolder = "dav/files/admin/"; fatalErrorPrefix = "Server replied with an error while reading directory '' : "; errorSpy.clear(); QVERIFY(!fakeFolder.syncOnce()); -- 2.30.2