Kaynağa Gözat

in wizard always use the correct way to get dav path

fixes listing being incorrect when using dav endpoint

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
Matthieu Gallien 4 yıl önce
ebeveyn
işleme
77433f7e1d

+ 1 - 12
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)

+ 3 - 2
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;

+ 2 - 2
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());