[frameworks/kdav] /: Use CardDAV allprop in multiget address-data
Bobr Vonabarak <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit 787b35a0ea52aaaa0b426ca49b37ca251962605a by Bobr Vonabarak.
Committed on 05/08/2026 at 10:54.
Pushed by carlschwan into branch 'master'.
Use CardDAV allprop in multiget address-data
CardDAV address-data has its own allprop element in the CardDAV namespace. The multiget request builder was putting DAV:allprop inside card:address-data, which some servers reject with HTTP 400.
Create the nested allprop element in the CardDAV namespace instead, and update the request serialization expectations in the tests.
M +3 -3 autotests/davitemsfetchjobtest.cpp
M +1 -1 src/protocols/carddavprotocol.cpp
https://invent.kde.org/frameworks/kdav/-/commit/787b35a0ea52aaaa0b426ca49b37ca251962605a
diff --git a/autotests/davitemsfetchjobtest.cpp b/autotests/davitemsfetchjobtest.cpp
index 5726e9a..cf3aa00 100644
--- a/autotests/davitemsfetchjobtest.cpp
+++ b/autotests/davitemsfetchjobtest.cpp
@@ -23,7 +23,7 @@ void DavItemsFetchJobTest::fetchCardDavSingleItem()
"B: <prop xmlns=\"DAV:\">",
"B: <getetag xmlns=\"DAV:\"/>",
"B: <address-data xmlns=\"urn:ietf:params:xml:ns:carddav\">",
- "B: <allprop xmlns=\"DAV:\"/>",
+ "B: <allprop xmlns=\"urn:ietf:params:xml:ns:carddav\"/>",
"B: </address-data>",
"B: </prop>",
"B: <href xmlns=\"DAV:\">/collection/item1.vcf</href>",
@@ -85,7 +85,7 @@ void DavItemsFetchJobTest::fetchCardDavTwoItems()
"B: <prop xmlns=\"DAV:\">",
"B: <getetag xmlns=\"DAV:\"/>",
"B: <address-data xmlns=\"urn:ietf:params:xml:ns:carddav\">",
- "B: <allprop xmlns=\"DAV:\"/>",
+ "B: <allprop xmlns=\"urn:ietf:params:xml:ns:carddav\"/>",
"B: </address-data>",
"B: </prop>",
"B: <href xmlns=\"DAV:\">/collection/item1.vcf</href>",
@@ -194,7 +194,7 @@ void DavItemsFetchJobTest::fetchCardDavSkipsNonOkPropstat()
"B: <prop xmlns=\"DAV:\">",
"B: <getetag xmlns=\"DAV:\"/>",
"B: <address-data xmlns=\"urn:ietf:params:xml:ns:carddav\">",
- "B: <allprop xmlns=\"DAV:\"/>",
+ "B: <allprop xmlns=\"urn:ietf:params:xml:ns:carddav\"/>",
"B: </address-data>",
"B: </prop>",
"B: <href xmlns=\"DAV:\">/collection/item1.vcf</href>",
diff --git a/src/protocols/carddavprotocol.cpp b/src/protocols/carddavprotocol.cpp
index 798a7c9..0fe3ba5 100644
--- a/src/protocols/carddavprotocol.cpp
+++ b/src/protocols/carddavprotocol.cpp
@@ -89,7 +89,7 @@ public:
propElement.appendChild(document.createElementNS(QStringLiteral("DAV:"), QStringLiteral("getetag")));
QDomElement addressDataElement = document.createElementNS(QStringLiteral("urn:ietf:params:xml:ns:carddav"), QStringLiteral("address-data"));
- addressDataElement.appendChild(document.createElementNS(QStringLiteral("DAV:"), QStringLiteral("allprop")));
+ addressDataElement.appendChild(document.createElementNS(QStringLiteral("urn:ietf:params:xml:ns:carddav"), QStringLiteral("allprop")));
propElement.appendChild(addressDataElement);
for (const QString &url : urls) {