diff --git a/src/server/services/wms/qgswmsdescribelayer.cpp b/src/server/services/wms/qgswmsdescribelayer.cpp index c3632aa68e5f..1c8fd8db44c5 100644 --- a/src/server/services/wms/qgswmsdescribelayer.cpp +++ b/src/server/services/wms/qgswmsdescribelayer.cpp @@ -54,16 +54,32 @@ namespace QgsWms QStringLiteral( "SLD_VERSION = %1 is not supported" ).arg( parameters[ QStringLiteral( "SLD_VERSION" )] ), 400 ); } - if ( !parameters.contains( QStringLiteral( "LAYERS" ) ) ) + if ( !parameters.contains( QStringLiteral( "LAYERS" ) ) && !parameters.contains( QStringLiteral( "LAYER" ) ) ) { throw QgsServiceException( QStringLiteral( "MissingParameterValue" ), - QStringLiteral( "LAYERS is mandatory for DescribeLayer operation" ), 400 ); + QStringLiteral( "LAYERS or LAYER is mandatory for DescribeLayer operation" ), 400 ); } + QStringList layersList; + #if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) - QStringList layersList = parameters[ QStringLiteral( "LAYERS" )].split( ',', QString::SkipEmptyParts ); + if ( parameters.contains( QStringLiteral( "LAYERS" ) ) ) + { + layersList = parameters[ QStringLiteral( "LAYERS" )].split( ',', QString::SkipEmptyParts ); + } + else + { + layersList = parameters[ QStringLiteral( "LAYER" )].split( ',', QString::SkipEmptyParts ); + } #else - const QStringList layersList = parameters[ QStringLiteral( "LAYERS" )].split( ',', Qt::SkipEmptyParts ); + if ( parameters.contains( QStringLiteral( "LAYERS" ) ) ) + { + layersList = parameters[ QStringLiteral( "LAYERS" )].split( ',', Qt::SkipEmptyParts ); + } + else + { + layersList = parameters[ QStringLiteral( "LAYER" )].split( ',', Qt::SkipEmptyParts ); + } #endif if ( layersList.isEmpty() ) {