Skip to content

Commit

Permalink
Server WMS fix case sensistive REQUEST
Browse files Browse the repository at this point in the history
Fixes #32354
  • Loading branch information
elpaso committed Oct 23, 2019
1 parent 3119209 commit c32caf8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/server/services/wms/qgswms.cpp
Expand Up @@ -95,8 +95,8 @@ namespace QgsWms
}

if ( ( mVersion.compare( QLatin1String( "1.1.1" ) ) == 0 \
&& req.compare( QLatin1String( "capabilities" ) ) == 0 )
|| req.compare( QLatin1String( "GetCapabilities" ) ) == 0 )
&& QSTR_COMPARE( req, "capabilities" ) )
|| QSTR_COMPARE( req, "GetCapabilities" ) )
{
writeGetCapabilities( mServerIface, project, version, request, response, false );
}
Expand Down Expand Up @@ -154,7 +154,7 @@ namespace QgsWms
{
// Operation not supported
throw QgsServiceException( QgsServiceException::OGC_OperationNotSupported,
QString( "Request %1 is not supported" ).arg( req ), 501 );
QStringLiteral( "Request %1 is not supported" ).arg( req ), 501 );
}
}

Expand Down
4 changes: 4 additions & 0 deletions tests/src/python/test_qgsserver_wms.py
Expand Up @@ -94,6 +94,10 @@ class TestQgsServerWMS(TestQgsServerWMSTestBase):
def test_getcapabilities(self):
self.wms_request_compare('GetCapabilities')

def test_getcapabilities_case_insensitive(self):
self.wms_request_compare('getcapabilities')
self.wms_request_compare('GETCAPABILITIES')

def test_getprojectsettings(self):
self.wms_request_compare('GetProjectSettings')

Expand Down

0 comments on commit c32caf8

Please sign in to comment.