ucb/source/ucp/webdav-curl/webdavcontent.cxx |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

New commits:
commit e1bb4425e442eacdc1ca3518d62116e739ba7eb0
Author:     Giuseppe Castagno <giuseppe.casta...@acca-esse.eu>
AuthorDate: Mon Feb 1 16:02:16 2016 +0100
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Mon Nov 1 18:30:33 2021 +0100

    ucb: webdav-curl: In case of Web site access, add Content-Type to HEAD 
request.
    
    This remove a necessity for another HEAD request when MediaType
    is requested while accessing a Web site, a cleaner implementation of
    d61352f58a7f750d3b0b0a9c2d6498fbb7a6e10d.
    
    This behavior is active only on a standard Web site, when PROPFIND
    failed earlier on the program flow, without retrieving the property
    DAV:getcontenttype.
    
    [ port of commit 9325c18044a8adc852e2d1b42a5a479ab6195da8 ]
    
    Change-Id: Iebdae815d096be8ef45b969d7c4d84acc26694b2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123280
    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 8bb0e5e82b15..ec16224b1066 100644
--- a/ucb/source/ucp/webdav-curl/webdavcontent.cxx
+++ b/ucb/source/ucp/webdav-curl/webdavcontent.cxx
@@ -1379,9 +1379,6 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues(
 
         if ( bNetworkAccessAllowed )
         {
-            if( eType != DAV )
-                m_bDidGetOrHead = false;
-
             // All properties obtained already?
             std::vector< OUString > aMissingProps;
             if ( !( xProps
@@ -1397,6 +1394,14 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues(
                     rProperties,
                     aHeaderNames );
 
+                if( eType != DAV )
+                {
+                    // in case of not DAV PROFIND (previously in program flow) 
failed
+                    // so we need to add the only prop that's common
+                    // to DAV and NON_DAV: MediaType, that maps to Content-Type
+                    aHeaderNames.push_back( "Content-Type" );
+                }
+
                 if ( !aHeaderNames.empty() )
                 {
                     try

Reply via email to