Skip to content

Commit

Permalink
WMS server: be more tolerant with exotic WMS clients and accept reque…
Browse files Browse the repository at this point in the history
…sts without service parameters
  • Loading branch information
mhugent committed Jul 21, 2011
1 parent 905561f commit 6849daf
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/mapserver/qgis_map_serv.cpp
Expand Up @@ -261,15 +261,19 @@ int main( int argc, char * argv[] )
adminConfigParser->setParameterMap( parameterMap );

//request to WMS?
QString serviceString( "WMS" );
std::map<QString, QString>::const_iterator serviceIt = parameterMap.find( "SERVICE" );
if ( serviceIt == parameterMap.end() )
if ( serviceIt != parameterMap.end() )
{
serviceString = serviceIt->second;
}
/*else
{
//tell the user that service parameter is mandatory
QgsDebugMsg( "unable to find 'SERVICE' parameter, exiting..." );
theRequestHandler->sendServiceException( QgsMapServiceException( "ServiceNotSpecified", "Service not specified. The SERVICE parameter is mandatory" ) );
delete theRequestHandler;
continue;
}
}*/

QgsWMSServer* theServer = 0;
try
Expand Down Expand Up @@ -350,7 +354,7 @@ int main( int argc, char * argv[] )
if ( result )
{
QgsDebugMsg( "Sending GetMap response" );
theRequestHandler->sendGetMapResponse( serviceIt->second, result );
theRequestHandler->sendGetMapResponse( serviceString, result );
}
else
{
Expand Down Expand Up @@ -427,7 +431,7 @@ int main( int argc, char * argv[] )
{
QgsDebugMsg( "Sending GetLegendGraphics response" );
//sending is the same for GetMap and GetLegendGraphics
theRequestHandler->sendGetMapResponse( serviceIt->second, result );
theRequestHandler->sendGetMapResponse( serviceString, result );
}
else
{
Expand Down

0 comments on commit 6849daf

Please sign in to comment.