Server WMS fix case sensistive REQUEST

Fixes #32354
This commit is contained in:
Alessandro Pasotti 2019-10-23 14:27:40 +02:00
parent 3119209334
commit c32caf8ab7
2 changed files with 7 additions and 3 deletions

View File

@ -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 );
}
@ -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 );
}
}

View File

@ -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')