Fix OGC test getfeatureinfo:invalid-info_format

This commit is contained in:
Blottiere Paul 2017-09-07 15:16:28 +01:00
parent e06ec71260
commit 5230680cdd
2 changed files with 11 additions and 1 deletions

View File

@ -1179,8 +1179,12 @@ namespace QgsWms
f = Format::XML;
else if ( fStr.startsWith( QLatin1String( "text/html" ), Qt::CaseInsensitive ) )
f = Format::HTML;
else if ( fStr.startsWith( QLatin1String( "text/plain" ), Qt::CaseInsensitive ) )
f = Format::TEXT;
else if ( fStr.startsWith( QLatin1String( "application/vnd.ogc.gml" ), Qt::CaseInsensitive ) )
f = Format::GML;
else
f = Format::NONE;
return f;
}

View File

@ -998,7 +998,13 @@ namespace QgsWms
QByteArray ba;
QgsWmsParameters::Format infoFormat = mWmsParameters.infoFormat();
if ( infoFormat == QgsWmsParameters::Format::TEXT )
if ( infoFormat == QgsWmsParameters::Format::NONE )
{
throw QgsBadRequestException( QStringLiteral( "InvalidFormat" ),
QStringLiteral( "Invalid INFO_FORMAT parameter" ) );
}
else if ( infoFormat == QgsWmsParameters::Format::TEXT )
ba = convertFeatureInfoToText( result );
else if ( infoFormat == QgsWmsParameters::Format::HTML )
ba = convertFeatureInfoToHtml( result );