ucb/source/ucp/webdav-curl/webdavcontent.cxx |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

New commits:
commit 8683c862ba6f7897e5f41294394f5f3bb18fcf16
Author:     Giuseppe Castagno <giuseppe.casta...@acca-esse.eu>
AuthorDate: Sun Oct 2 10:58:52 2016 +0200
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Mon Nov 1 18:49:53 2021 +0100

    ucb: webdav-curl: tdf#101094 (35): Add OPTIONS as pre-check in direct 
WebDAV open() method
    
    The function call will act as a precheck on Web resource access
    error when accessing the open directly without the normal file
    open procedure, e.g. accessing Web resource property values first.
    
    An example of this direct open call are the extension fetching and
    the extension update check.
    
    [ port of commit 909b6b84944e17141109272d917dcf4887483e5a ]
    
    Change-Id: Ic04903cfc1b056e150a080fc32428d43e3f842e8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123494
    Tested-by: Michael Stahl <michael.st...@allotropia.de>
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/ucb/source/ucp/webdav-curl/webdavcontent.cxx 
b/ucb/source/ucp/webdav-curl/webdavcontent.cxx
index 331ca1a085e0..d421d9ade8b1 100644
--- a/ucb/source/ucp/webdav-curl/webdavcontent.cxx
+++ b/ucb/source/ucp/webdav-curl/webdavcontent.cxx
@@ -2163,7 +2163,15 @@ uno::Any Content::open(
 
                     removeCachedPropertyNames( xResAccess->getURL() );
                     // check if the resource was present on the server
-                    if( aStaticDAVOptionsCache.isResourceFound( aTargetURL ) )
+                    // first update it, if necessary
+                    // if the open is called directly, without the default 
open sequence,
+                    // e.g. the one used when opening a file looking for 
properties
+                    // first this call will have no effect, since OPTIONS 
would have already been called
+                    // as a consequence of getPropertyValues()
+                    DAVOptions aDAVOptions;
+                    getResourceOptions( xEnv, aDAVOptions, xResAccess );
+
+                    if( aDAVOptions.isResourceFound() )
                     {
                         uno::Reference< io::XInputStream > xIn
                             = xResAccess->GET( aHeaders, aResource, xEnv );

Reply via email to