Skip to content
Permalink
Browse files

Add non-default port numbers to GetMap and GetFeatureInfo urls

  • Loading branch information
mhugent committed Aug 26, 2011
1 parent 0d688d4 commit 339d800a1fed787c65cd3410d2ca479df51a7a00
Showing with 16 additions and 0 deletions.
  1. +16 −0 src/mapserver/qgswmsserver.cpp
@@ -110,6 +110,22 @@ QDomDocument QgsWMSServer::getCapabilities()
QString requestUrl = getenv( "REQUEST_URI" );
QUrl mapUrl( requestUrl );
mapUrl.setHost( QString( getenv( "SERVER_NAME" ) ) );

//Add non-default ports to url
QString portString = getenv( "SERVER_PORT" );
if ( !portString.isEmpty() )
{
bool portOk;
int portNumber = portString.toInt( &portOk );
if ( portOk )
{
if ( portNumber != 80 )
{
mapUrl.setPort( portNumber );
}
}
}

if ( QString( getenv( "HTTPS" ) ).compare( "on", Qt::CaseInsensitive ) == 0 )
{
mapUrl.setScheme( "https" );

0 comments on commit 339d800

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