From a6c21346d4374ea9a0c1e4e1b05e443f48cef65b Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Mon, 1 Nov 2021 13:27:36 +0100 Subject: 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 Reviewed-by: Michael Stahl --- ucb/source/ucp/webdav-curl/CurlSession.cxx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'ucb') 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 const options{ { CURLOPT_CUSTOMREQUEST, "MKCOL", - "CURLOPT_CUSTOMREQUEST" } }; + ::std::vector 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 const options{ { CURLOPT_CUSTOMREQUEST, pMethod, - "CURLOPT_CUSTOMREQUEST" } }; + ::std::vector 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 const options{ { CURLOPT_CUSTOMREQUEST, "DELETE", + ::std::vector const options{ { CURLOPT_NOBODY, 1L, nullptr }, + { CURLOPT_CUSTOMREQUEST, "DELETE", "CURLOPT_CUSTOMREQUEST" } }; CurlProcessor::ProcessRequest(*this, uri, options, &rEnv, nullptr, nullptr, nullptr, nullptr); -- cgit