summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Castagno <giuseppe.castagno@acca-esse.eu>2016-01-29 16:11:26 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-02-02 12:18:14 +0000
commit3d03b2f51912e7ca49251befca3fa61021dc6154 (patch)
tree7a2fdd61974ba7244e962440d2322c4b0da70ca6
parent9bf2ca40890a56a8029f702f94fcaa79dc019469 (diff)
Related tdf#95217: Http header names are case insensitive
Change-Id: I0d81e110a31f93f5f24a96f96c12f0ec9c95921b Reviewed-on: https://gerrit.libreoffice.org/21906 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: jan iversen <jani@documentfoundation.org> (cherry picked from commit e973b342826e54f147251b132c3325d30749e312) Reviewed-on: https://gerrit.libreoffice.org/21987 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--ucb/source/ucp/webdav-neon/ContentProperties.cxx6
-rw-r--r--ucb/source/ucp/webdav-neon/NeonHeadRequest.cxx6
2 files changed, 8 insertions, 4 deletions
diff --git a/ucb/source/ucp/webdav-neon/ContentProperties.cxx b/ucb/source/ucp/webdav-neon/ContentProperties.cxx
index 9c39daa30150..f7f97309dae7 100644
--- a/ucb/source/ucp/webdav-neon/ContentProperties.cxx
+++ b/ucb/source/ucp/webdav-neon/ContentProperties.cxx
@@ -433,7 +433,7 @@ void ContentProperties::addProperty( const OUString & rName,
(*m_xProps)[ OUString("Size") ]
= PropertyValue( uno::makeAny( aValue.toInt64() ), true );
}
- else if ( rName == "Content-Length" )
+ else if ( rName.equalsIgnoreAsciiCase( "Content-Length" ) )
{
// Do NOT map Content-length entity header to DAV:getcontentlength!
// Only DAV resources have this property.
@@ -451,7 +451,7 @@ void ContentProperties::addProperty( const OUString & rName,
(*m_xProps)[ OUString("MediaType") ]
= PropertyValue( rValue, true );
}
- else if ( rName == "Content-Type" )
+ else if ( rName.equalsIgnoreAsciiCase( "Content-Type" ) )
{
// Do NOT map Content-Type entity header to DAV:getcontenttype!
// Only DAV resources have this property.
@@ -474,7 +474,7 @@ void ContentProperties::addProperty( const OUString & rName,
(*m_xProps)[ OUString("DateModified") ]
= PropertyValue( uno::makeAny( aDate ), true );
}
- else if ( rName == "Last-Modified" )
+ else if ( rName.equalsIgnoreAsciiCase( "Last-Modified" ) )
{
// Do not map Last-Modified entity header to DAV:getlastmodified!
// Only DAV resources have this property.
diff --git a/ucb/source/ucp/webdav-neon/NeonHeadRequest.cxx b/ucb/source/ucp/webdav-neon/NeonHeadRequest.cxx
index cdf3be9014b8..0d399083cd9b 100644
--- a/ucb/source/ucp/webdav-neon/NeonHeadRequest.cxx
+++ b/ucb/source/ucp/webdav-neon/NeonHeadRequest.cxx
@@ -81,8 +81,12 @@ void process_headers( ne_request * req,
while ( it != end )
{
- if ( (*it) == aHeaderName )
+ // header names are case insensitive
+ if ( (*it).equalsIgnoreAsciiCase( aHeaderName ) )
+ {
+ aHeaderName = (*it);
break;
+ }
++it;
}