summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2021-11-24 19:52:10 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2021-11-25 18:53:05 +0100
commit97af6ccd95b9548723c2baa4b051c049c47bc8ea (patch)
treec303cf8368d2b9605908f3b961fe4490cebf5ac6 /ucb
parenta8ae1ffffa3d2621a3e7d3fa538a2b98e2ad7a12 (diff)
ucb: webdav-curl: Sharepoint returns redirect urls that curl can't parse
Encode them just like in WebDAVResponseParser. Change-Id: I7f0ee1d42df356fdd585d1f6e0f39e4094701a2a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125787 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/ucp/webdav-curl/CurlSession.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/ucb/source/ucp/webdav-curl/CurlSession.cxx b/ucb/source/ucp/webdav-curl/CurlSession.cxx
index 509c7bc24629..1c9da506df8e 100644
--- a/ucb/source/ucp/webdav-curl/CurlSession.cxx
+++ b/ucb/source/ucp/webdav-curl/CurlSession.cxx
@@ -1012,10 +1012,14 @@ auto CurlProcessor::ProcessRequestImpl(
assert(rc == CURLE_OK);
if (pRedirectURL)
{
- throw DAVException(DAVException::DAV_HTTP_REDIRECT,
- pRedirectURL ? OUString(pRedirectURL, strlen(pRedirectURL),
- RTL_TEXTENCODING_UTF8)
- : OUString());
+ // Sharepoint 2016 workaround: contains unencoded U+0020
+ OUString const redirectURL(::rtl::Uri::encode(
+ pRedirectURL
+ ? OUString(pRedirectURL, strlen(pRedirectURL), RTL_TEXTENCODING_UTF8)
+ : OUString(),
+ rtl_UriCharClassUric, rtl_UriEncodeKeepEscapes, RTL_TEXTENCODING_UTF8));
+
+ throw DAVException(DAVException::DAV_HTTP_REDIRECT, redirectURL);
}
[[fallthrough]];
}