Skip to content
Permalink
Browse files

WMS server: be more tolerant with exotic WMS clients and accept reque…

…sts without service parameters
  • Loading branch information
mhugent committed Jul 21, 2011
1 parent 905561f commit 6849dafe12730a87a89ef62a3be2be7765e776dd
Showing with 9 additions and 5 deletions.
  1. +9 −5 src/mapserver/qgis_map_serv.cpp
@@ -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
@@ -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
{
@@ -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
{

0 comments on commit 6849daf

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