diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2021-11-01 13:27:36 +0100 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2021-11-01 19:03:14 +0100 |
commit | a6c21346d4374ea9a0c1e4e1b05e443f48cef65b (patch) | |
tree | 6ea964832d8037f2397ddd4703f30f99d00cd903 /ucb | |
parent | d4acfea2fed8f999347e49ed76c3f5115952df5c (diff) |
ucb: webdav-curl: fix MOVE/COPY/DELETE crash
These need "nobody"; some errors like 401 will return a body that should
be ignored.
Change-Id: If2f726aa34d4d3fae1bd61bc87b62e2d55a7ff26
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124561
Tested-by: Michael Stahl <michael.stahl@allotropia.de>
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/source/ucp/webdav-curl/CurlSession.cxx | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/ucb/source/ucp/webdav-curl/CurlSession.cxx b/ucb/source/ucp/webdav-curl/CurlSession.cxx index a3426f7ddd89..d7a0f62ce606 100644 --- a/ucb/source/ucp/webdav-curl/CurlSession.cxx +++ b/ucb/source/ucp/webdav-curl/CurlSession.cxx @@ -1915,8 +1915,9 @@ auto CurlSession::MKCOL(OUString const& rURIReference, DAVRequestEnvironment con CurlUri const uri(CurlProcessor::URIReferenceToURI(*this, rURIReference)); - ::std::vector<CurlOption> const options{ { CURLOPT_CUSTOMREQUEST, "MKCOL", - "CURLOPT_CUSTOMREQUEST" } }; + ::std::vector<CurlOption> const options{ + { CURLOPT_NOBODY, 1L, nullptr }, { CURLOPT_CUSTOMREQUEST, "MKCOL", "CURLOPT_CUSTOMREQUEST" } + }; CurlProcessor::ProcessRequest(*this, uri, options, &rEnv, nullptr, nullptr, nullptr, nullptr); } @@ -1943,8 +1944,9 @@ auto CurlProcessor::MoveOrCopy(CurlSession& rSession, OUString const& rSourceURI throw uno::RuntimeException("curl_slist_append failed"); } - ::std::vector<CurlOption> const options{ { CURLOPT_CUSTOMREQUEST, pMethod, - "CURLOPT_CUSTOMREQUEST" } }; + ::std::vector<CurlOption> const options{ + { CURLOPT_NOBODY, 1L, nullptr }, { CURLOPT_CUSTOMREQUEST, pMethod, "CURLOPT_CUSTOMREQUEST" } + }; CurlProcessor::ProcessRequest(rSession, uriSource, options, &rEnv, ::std::move(pList), nullptr, nullptr, nullptr); @@ -1974,7 +1976,8 @@ auto CurlSession::DESTROY(OUString const& rURIReference, DAVRequestEnvironment c CurlUri const uri(CurlProcessor::URIReferenceToURI(*this, rURIReference)); - ::std::vector<CurlOption> const options{ { CURLOPT_CUSTOMREQUEST, "DELETE", + ::std::vector<CurlOption> const options{ { CURLOPT_NOBODY, 1L, nullptr }, + { CURLOPT_CUSTOMREQUEST, "DELETE", "CURLOPT_CUSTOMREQUEST" } }; CurlProcessor::ProcessRequest(*this, uri, options, &rEnv, nullptr, nullptr, nullptr, nullptr); |