Fixup commit 835c9163374f42003aa2f7795ade3f4ff62c8877
authorOlivier Goffart <ogoffart@woboq.com>
Mon, 15 Oct 2018 16:05:51 +0000 (18:05 +0200)
committerKevin Ottens <kevin.ottens@nextcloud.com>
Tue, 15 Dec 2020 09:58:08 +0000 (10:58 +0100)
The previous code considered the also HTTP 207 code without the
application/xml header to have this message.
httpCode 0 does not make much sense anyway.

This change the behavior to consider any 2xx without the xml header
to show this error message

src/libsync/discoveryphase.cpp

index d582ed1e14bf101287bbfc7a3fb2a846023c5552..06bd6998abe1c509d50085c0f055b4c8e5f69218 100644 (file)
@@ -354,7 +354,7 @@ void DiscoverySingleDirectoryJob::lsJobFinishedWithErrorSlot(QNetworkReply *r)
     QString httpReason = r->attribute(QNetworkRequest::HttpReasonPhraseAttribute).toString();
     QString msg = r->errorString();
     qCWarning(lcDiscovery) << "LSCOL job error" << r->errorString() << httpCode << r->error();
-    if (httpCode == 0 && r->error() == QNetworkReply::NoError
+    if (r->error() == QNetworkReply::NoError
         && !contentType.contains("application/xml; charset=utf-8")) {
         msg = tr("Server error: PROPFIND reply is not XML formatted!");
     }