Skip to content
Permalink
Browse files

Fix OGC test getfeatureinfo:invalid-info_format

  • Loading branch information
pblottiere committed Sep 29, 2017
1 parent e06ec71 commit 5230680cdd89b955c33dec955b2ea3c43d47a18c
Showing with 11 additions and 1 deletion.
  1. +4 −0 src/server/services/wms/qgswmsparameters.cpp
  2. +7 −1 src/server/services/wms/qgswmsrenderer.cpp
@@ -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;
}
@@ -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 );

0 comments on commit 5230680

Please sign in to comment.
You can’t perform that action at this time.