summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Petry <PVince81@yahoo.fr>2021-01-04 14:22:19 +0100
committerVincent Petry <PVince81@yahoo.fr>2021-01-04 14:28:42 +0100
commit687788e4d30bf36dd93c39d72335f331f49f0745 (patch)
treebcb5d9c69861236fc75f07e824a96320ff1d110a
parent5348f8c9c88b930d06042e5103ffb617d2c09d75 (diff)
Fix Webdav storage PROPFIND request
Remove additional "a:prop" in PROPFIND request to match RFC 4918 section 9.1.3. Added Content-Type header as the body is not a true multipart POST. Signed-off-by: Vincent Petry <PVince81@yahoo.fr>
-rw-r--r--src/storage/plugins/CurlStorage.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/storage/plugins/CurlStorage.cxx b/src/storage/plugins/CurlStorage.cxx
index ccfb0bf12..ad6f71fce 100644
--- a/src/storage/plugins/CurlStorage.cxx
+++ b/src/storage/plugins/CurlStorage.cxx
@@ -262,18 +262,19 @@ public:
request.SetOption(CURLOPT_MAXREDIRS, 1L);
request_headers.Append(StringFormat<40>("depth: %u", depth));
+ request_headers.Append("content-type: text/xml");
request.SetOption(CURLOPT_HTTPHEADER, request_headers.Get());
request.SetOption(CURLOPT_POSTFIELDS,
"<?xml version=\"1.0\"?>\n"
"<a:propfind xmlns:a=\"DAV:\">"
- "<a:prop><a:resourcetype/></a:prop>"
- "<a:prop><a:getcontenttype/></a:prop>"
- "<a:prop><a:getcontentlength/></a:prop>"
+ "<a:prop>"
+ "<a:resourcetype/>"
+ "<a:getcontenttype/>"
+ "<a:getcontentlength/>"
+ "</a:prop>"
"</a:propfind>");
-
- // TODO: send request body
}
using BlockingHttpRequest::GetEasy;