Skip to content

Commit

Permalink
Add non-default port numbers to GetMap and GetFeatureInfo urls
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Aug 26, 2011
1 parent 0d688d4 commit 339d800
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/mapserver/qgswmsserver.cpp
Expand Up @@ -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" );
Expand Down

0 comments on commit 339d800

Please sign in to comment.