Skip to content
Permalink
Browse files

Fixed a bug where map= was not being published in onlineresource url …

…when project files are not in the same dir as cgi
  • Loading branch information
timlinux committed Jun 28, 2011
1 parent 22b367d commit e07596c421f47c63b4da6233e8d26d446f8476f9
Showing with 19 additions and 1 deletion.
  1. +19 −1 src/mapserver/qgswmsserver.cpp
@@ -106,14 +106,32 @@ QDomDocument QgsWMSServer::getCapabilities()
//Some client requests already have http://<SERVER_NAME> in the REQUEST_URI variable
QString hrefString;
QString requestUrl = getenv( "REQUEST_URI" );
QString mapUrl = requestUrl;
requestUrl.truncate( requestUrl.indexOf( "?" ) + 1 );

// find out if a map parameter was specified and ensure
// it is propogated to the onlineresource
mapUrl.replace( requestUrl, "" );
QStringList myTokens = mapUrl.split( "&" );
QString myMap = "";
QStringListIterator myIterator( myTokens );
while ( myIterator.hasNext() )
{
QString myString = myIterator.next();
if ( myString.contains( "map=", Qt::CaseInsensitive ) )
{
myMap = myString;
}
}


if ( requestUrl.contains( "http" ) )
{
hrefString = requestUrl;
}
else
{
hrefString = "http://" + QString( getenv( "SERVER_NAME" ) ) + requestUrl;
hrefString = "http://" + QString( getenv( "SERVER_NAME" ) ) + requestUrl + myMap;
}


0 comments on commit e07596c

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