summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2021-10-28 12:49:41 +0200
committerMichael Stahl <michael.stahl@allotropia.de>2021-11-01 18:57:58 +0100
commit7cd5647b9d02be7527f78a08d49c742be4c34c34 (patch)
treeaa2f3a4a4f03031d7173801bfe49026b616981a2 /ucb
parent68627126454762ddfb4605c0e58c634b54937ad0 (diff)
ucb: webdav-curl: convert hrefs in PROPFIND response to URI
curl_url_set(..., CURLUPART_URL, ...) doesn't work with relative URLs that are absolute paths. Change-Id: Ic67c99262fe5b399511f7a2e7b8592d7e065b2c3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124451 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/ucp/webdav-curl/CurlSession.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/ucb/source/ucp/webdav-curl/CurlSession.cxx b/ucb/source/ucp/webdav-curl/CurlSession.cxx
index e5dcd1a2ea3c..3fe73b57f873 100644
--- a/ucb/source/ucp/webdav-curl/CurlSession.cxx
+++ b/ucb/source/ucp/webdav-curl/CurlSession.cxx
@@ -1312,6 +1312,22 @@ auto CurlProcessor::PropFind(
{
*::std::get<1>(*o_pRequestedProperties)
= parseWebDAVPropFindResponse(xResponseInStream);
+ for (DAVResource& it : *::std::get<1>(*o_pRequestedProperties))
+ {
+ // caller will give these uris to CurlUri so can't be relative
+ if (it.uri.startsWith("/"))
+ {
+ try
+ {
+ it.uri = rSession.m_URI.CloneWithRelativeRefPathAbsolute(it.uri).GetURI();
+ }
+ catch (DAVException const&)
+ {
+ SAL_INFO("ucb.ucp.webdav.curl",
+ "PROPFIND: exception parsing uri " << it.uri);
+ }
+ }
+ }
}
else
{