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>
This commit is contained in:
Vincent Petry 2021-01-04 14:22:19 +01:00
parent 5348f8c9c8
commit 687788e4d3
No known key found for this signature in database
GPG Key ID: E055D6A4D513575C
1 changed files with 6 additions and 5 deletions

View File

@ -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;