ucb/source/ucp/webdav-curl/CurlSession.cxx |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

New commits:
commit 7cd5647b9d02be7527f78a08d49c742be4c34c34
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Thu Oct 28 12:49:41 2021 +0200
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Mon Nov 1 18:57:58 2021 +0100

    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.st...@allotropia.de>

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
         {

Reply via email to