summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Castagno <giuseppe.castagno@acca-esse.eu>2016-10-02 10:58:52 +0200
committerGiuseppe Castagno <giuseppe.castagno@acca-esse.eu>2016-10-03 07:54:37 +0000
commit909b6b84944e17141109272d917dcf4887483e5a (patch)
tree19651ec1739becff6ba31a629a2f611cd8680a81
parentfe8ec3f3f09aae165c854294ad52d6870e70ef8e (diff)
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. Change-Id: I765a2fe29f432a07a649e5a35440ae351c681af9 Reviewed-on: https://gerrit.libreoffice.org/29454 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Giuseppe Castagno <giuseppe.castagno@acca-esse.eu>
-rw-r--r--ucb/source/ucp/webdav-neon/webdavcontent.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/ucb/source/ucp/webdav-neon/webdavcontent.cxx b/ucb/source/ucp/webdav-neon/webdavcontent.cxx
index e6153ffd6853..8f0a83c80c6f 100644
--- a/ucb/source/ucp/webdav-neon/webdavcontent.cxx
+++ b/ucb/source/ucp/webdav-neon/webdavcontent.cxx
@@ -2292,7 +2292,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 );