Skip to content
Permalink
Browse files

Add scheme (http or https) to service urls in capabilities

  • Loading branch information
Marco Hugentobler
Marco Hugentobler committed Jul 20, 2011
1 parent 73066cf commit ad7e50208920369729e18493d5d4747e8e8741b8
Showing with 12 additions and 4 deletions.
  1. +12 −4 src/mapserver/qgswmsserver.cpp
16 src/mapserver/qgswmsserver.cpp 100755 → 100644
@@ -110,6 +110,14 @@ QDomDocument QgsWMSServer::getCapabilities()
QString requestUrl = getenv( "REQUEST_URI" );
QUrl mapUrl( requestUrl );
mapUrl.setHost( QString( getenv( "SERVER_NAME" ) ) );
if ( QString( getenv( "HTTPS" ) ).compare( "on", Qt::CaseInsensitive ) == 0 )
{
mapUrl.setScheme( "https" );
}
else
{
mapUrl.setScheme( "http" );
}
mapUrl.removeQueryItem( "REQUEST" );
mapUrl.removeQueryItem( "VERSION" );
mapUrl.removeQueryItem( "SERVICE" );
@@ -1625,20 +1633,20 @@ QMap<QString, QString> QgsWMSServer::applyRequestedLayerFilters( const QStringLi

//No BBOX parameter in request. We use the union of the filtered layer
//to provide the functionality of zooming to selected records via (enhanced) WMS.
if( mMapRenderer && mMapRenderer->extent().isEmpty() )
if ( mMapRenderer && mMapRenderer->extent().isEmpty() )
{
QgsRectangle filterExtent;
QMap<QString, QString>::const_iterator filterIt = filterMap.constBegin();
for(; filterIt != filterMap.constEnd(); ++filterIt )
for ( ; filterIt != filterMap.constEnd(); ++filterIt )
{
QgsMapLayer* mapLayer = QgsMapLayerRegistry::instance()->mapLayer( filterIt.key() );
if( !mapLayer )
if ( !mapLayer )
{
continue;
}

QgsRectangle layerExtent = mapLayer->extent();
if( filterExtent.isEmpty() )
if ( filterExtent.isEmpty() )
{
filterExtent = layerExtent;
}

0 comments on commit ad7e502

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